From b5ec4cd54c0ac6276a33bad9942ce34e02e065ea Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Aug 2023 03:31:45 +0000 Subject: [PATCH] CodeGen from PR 25406 in Azure/azure-rest-api-specs update typescript.md in resource (#25406) * update typescript.md in resource * update --- sdk/resources/azure-mgmt-resource/_meta.json | 64 ++- .../mgmt/resource/changes/_changes_client.py | 4 +- .../mgmt/resource/changes/_serialization.py | 30 +- .../resource/changes/aio/_changes_client.py | 4 +- .../changes/v2022_05_01/_changes_client.py | 2 +- .../resource/changes/v2022_05_01/_vendor.py | 14 - .../resource/changes/v2022_05_01/_version.py | 2 +- .../v2022_05_01/aio/_changes_client.py | 2 +- .../v2022_05_01/aio/operations/_operations.py | 5 +- .../v2022_05_01/operations/_operations.py | 11 +- .../_deployment_scripts_client.py | 4 +- .../deploymentscripts/_serialization.py | 30 +- .../aio/_deployment_scripts_client.py | 4 +- .../_deployment_scripts_client.py | 2 +- .../v2019_10_01_preview/_vendor.py | 14 - .../v2019_10_01_preview/_version.py | 2 +- .../aio/_deployment_scripts_client.py | 2 +- .../aio/operations/_operations.py | 37 +- .../operations/_operations.py | 55 ++- .../v2020_10_01/_deployment_scripts_client.py | 2 +- .../deploymentscripts/v2020_10_01/_vendor.py | 14 - .../deploymentscripts/v2020_10_01/_version.py | 2 +- .../aio/_deployment_scripts_client.py | 2 +- .../v2020_10_01/aio/operations/_operations.py | 19 +- .../v2020_10_01/operations/_operations.py | 37 +- .../_deployment_stacks_client.py | 4 +- .../deploymentstacks/_serialization.py | 30 +- .../aio/_deployment_stacks_client.py | 4 +- .../_deployment_stacks_client.py | 2 +- .../v2022_08_01_preview/_vendor.py | 14 - .../v2022_08_01_preview/_version.py | 2 +- .../aio/_deployment_stacks_client.py | 2 +- .../aio/operations/_operations.py | 85 +++- .../operations/_operations.py | 117 +++-- .../mgmt/resource/features/_feature_client.py | 6 +- .../mgmt/resource/features/_serialization.py | 30 +- .../resource/features/aio/_feature_client.py | 6 +- .../features/v2015_12_01/_feature_client.py | 2 +- .../resource/features/v2015_12_01/_vendor.py | 14 +- .../resource/features/v2015_12_01/_version.py | 2 +- .../v2015_12_01/aio/_feature_client.py | 2 +- .../v2015_12_01/aio/operations/_operations.py | 21 +- .../v2015_12_01/operations/_operations.py | 33 +- .../features/v2021_07_01/_feature_client.py | 4 +- .../resource/features/v2021_07_01/_vendor.py | 14 +- .../resource/features/v2021_07_01/_version.py | 2 +- .../v2021_07_01/aio/_feature_client.py | 4 +- .../v2021_07_01/aio/operations/_operations.py | 32 +- .../v2021_07_01/operations/_operations.py | 54 ++- .../resource/links/_management_link_client.py | 6 +- .../mgmt/resource/links/_serialization.py | 30 +- .../links/aio/_management_link_client.py | 6 +- .../v2016_09_01/_management_link_client.py | 6 +- .../resource/links/v2016_09_01/_vendor.py | 14 - .../resource/links/v2016_09_01/_version.py | 2 +- .../aio/_management_link_client.py | 6 +- .../v2016_09_01/aio/operations/_operations.py | 14 +- .../v2016_09_01/operations/_operations.py | 26 +- .../resource/locks/_management_lock_client.py | 6 +- .../mgmt/resource/locks/_serialization.py | 30 +- .../locks/aio/_management_lock_client.py | 6 +- .../v2015_01_01/_management_lock_client.py | 2 +- .../resource/locks/v2015_01_01/_vendor.py | 14 - .../resource/locks/v2015_01_01/_version.py | 2 +- .../aio/_management_lock_client.py | 2 +- .../v2015_01_01/aio/operations/_operations.py | 23 +- .../v2015_01_01/operations/_operations.py | 47 +- .../v2016_09_01/_management_lock_client.py | 4 +- .../resource/locks/v2016_09_01/_vendor.py | 14 - .../resource/locks/v2016_09_01/_version.py | 2 +- .../aio/_management_lock_client.py | 4 +- .../v2016_09_01/aio/operations/_operations.py | 36 +- .../v2016_09_01/operations/_operations.py | 70 +-- .../_application_client.py | 8 +- .../managedapplications/_serialization.py | 30 +- .../aio/_application_client.py | 8 +- .../v2019_07_01/_application_client.py | 10 +- .../v2019_07_01/_vendor.py | 14 +- .../v2019_07_01/_version.py | 2 +- .../v2019_07_01/aio/_application_client.py | 10 +- .../v2019_07_01/aio/operations/_operations.py | 81 ++-- .../v2019_07_01/operations/_operations.py | 131 +++--- .../mgmt/resource/policy/_policy_client.py | 16 +- .../mgmt/resource/policy/_serialization.py | 30 +- .../resource/policy/aio/_policy_client.py | 16 +- .../v2015_10_01_preview/_policy_client.py | 4 +- .../policy/v2015_10_01_preview/_vendor.py | 14 - .../policy/v2015_10_01_preview/_version.py | 2 +- .../v2015_10_01_preview/aio/_policy_client.py | 4 +- .../aio/operations/_operations.py | 54 ++- .../operations/_operations.py | 82 ++-- .../policy/v2016_04_01/_policy_client.py | 4 +- .../resource/policy/v2016_04_01/_vendor.py | 14 - .../resource/policy/v2016_04_01/_version.py | 2 +- .../policy/v2016_04_01/aio/_policy_client.py | 4 +- .../v2016_04_01/aio/operations/_operations.py | 28 +- .../v2016_04_01/operations/_operations.py | 56 +-- .../policy/v2016_12_01/_policy_client.py | 4 +- .../resource/policy/v2016_12_01/_vendor.py | 14 - .../resource/policy/v2016_12_01/_version.py | 2 +- .../policy/v2016_12_01/aio/_policy_client.py | 4 +- .../v2016_12_01/aio/operations/_operations.py | 40 +- .../v2016_12_01/operations/_operations.py | 78 ++-- .../v2017_06_01_preview/_policy_client.py | 4 +- .../policy/v2017_06_01_preview/_vendor.py | 14 - .../policy/v2017_06_01_preview/_version.py | 2 +- .../v2017_06_01_preview/aio/_policy_client.py | 4 +- .../aio/operations/_operations.py | 78 +++- .../operations/_operations.py | 116 +++-- .../policy/v2018_03_01/_policy_client.py | 6 +- .../resource/policy/v2018_03_01/_vendor.py | 14 - .../resource/policy/v2018_03_01/_version.py | 2 +- .../policy/v2018_03_01/aio/_policy_client.py | 6 +- .../v2018_03_01/aio/operations/_operations.py | 61 +-- .../v2018_03_01/operations/_operations.py | 117 ++--- .../policy/v2018_05_01/_policy_client.py | 6 +- .../resource/policy/v2018_05_01/_vendor.py | 14 - .../resource/policy/v2018_05_01/_version.py | 2 +- .../policy/v2018_05_01/aio/_policy_client.py | 6 +- .../v2018_05_01/aio/operations/_operations.py | 61 +-- .../v2018_05_01/operations/_operations.py | 117 ++--- .../policy/v2019_01_01/_policy_client.py | 6 +- .../resource/policy/v2019_01_01/_vendor.py | 14 - .../resource/policy/v2019_01_01/_version.py | 2 +- .../policy/v2019_01_01/aio/_policy_client.py | 6 +- .../v2019_01_01/aio/operations/_operations.py | 61 +-- .../v2019_01_01/operations/_operations.py | 117 ++--- .../policy/v2019_06_01/_policy_client.py | 6 +- .../resource/policy/v2019_06_01/_vendor.py | 14 - .../resource/policy/v2019_06_01/_version.py | 2 +- .../policy/v2019_06_01/aio/_policy_client.py | 6 +- .../v2019_06_01/aio/operations/_operations.py | 61 +-- .../v2019_06_01/operations/_operations.py | 117 ++--- .../policy/v2019_09_01/_policy_client.py | 6 +- .../resource/policy/v2019_09_01/_vendor.py | 14 - .../resource/policy/v2019_09_01/_version.py | 2 +- .../policy/v2019_09_01/aio/_policy_client.py | 6 +- .../v2019_09_01/aio/operations/_operations.py | 63 +-- .../v2019_09_01/operations/_operations.py | 121 ++--- .../v2020_07_01_preview/_policy_client.py | 2 +- .../policy/v2020_07_01_preview/_vendor.py | 14 - .../policy/v2020_07_01_preview/_version.py | 2 +- .../v2020_07_01_preview/aio/_policy_client.py | 2 +- .../aio/operations/_operations.py | 29 +- .../operations/_operations.py | 45 +- .../policy/v2020_09_01/_policy_client.py | 8 +- .../resource/policy/v2020_09_01/_vendor.py | 14 - .../resource/policy/v2020_09_01/_version.py | 2 +- .../policy/v2020_09_01/aio/_policy_client.py | 8 +- .../v2020_09_01/aio/operations/_operations.py | 68 +-- .../v2020_09_01/operations/_operations.py | 128 +++--- .../policy/v2021_06_01/_policy_client.py | 6 +- .../resource/policy/v2021_06_01/_vendor.py | 14 - .../resource/policy/v2021_06_01/_version.py | 2 +- .../policy/v2021_06_01/aio/_policy_client.py | 6 +- .../v2021_06_01/aio/operations/_operations.py | 67 +-- .../v2021_06_01/operations/_operations.py | 129 +++--- .../policy/v2022_06_01/_policy_client.py | 2 +- .../resource/policy/v2022_06_01/_vendor.py | 14 - .../resource/policy/v2022_06_01/_version.py | 2 +- .../policy/v2022_06_01/aio/_policy_client.py | 2 +- .../v2022_06_01/aio/operations/_operations.py | 25 +- .../v2022_06_01/operations/_operations.py | 51 +-- .../v2022_07_01_preview/_policy_client.py | 2 +- .../policy/v2022_07_01_preview/_vendor.py | 14 - .../policy/v2022_07_01_preview/_version.py | 2 +- .../v2022_07_01_preview/aio/_policy_client.py | 2 +- .../aio/operations/_operations.py | 33 +- .../operations/_operations.py | 51 ++- .../v2022_08_01_preview/_policy_client.py | 8 +- .../policy/v2022_08_01_preview/_vendor.py | 14 - .../policy/v2022_08_01_preview/_version.py | 2 +- .../v2022_08_01_preview/aio/_policy_client.py | 8 +- .../aio/operations/_operations.py | 66 ++- .../operations/_operations.py | 100 +++-- .../_resource_private_link_client.py | 6 +- .../resource/privatelinks/_serialization.py | 30 +- .../aio/_resource_private_link_client.py | 6 +- .../_resource_private_link_client.py | 4 +- .../privatelinks/v2020_05_01/_vendor.py | 14 - .../privatelinks/v2020_05_01/_version.py | 2 +- .../aio/_resource_private_link_client.py | 4 +- .../v2020_05_01/aio/operations/_operations.py | 20 +- .../v2020_05_01/operations/_operations.py | 40 +- .../resources/_resource_management_client.py | 18 +- .../mgmt/resource/resources/_serialization.py | 30 +- .../aio/_resource_management_client.py | 18 +- .../_resource_management_client.py | 20 +- .../resource/resources/v2016_02_01/_vendor.py | 14 - .../resources/v2016_02_01/_version.py | 2 +- .../aio/_resource_management_client.py | 20 +- .../v2016_02_01/aio/operations/_operations.py | 74 ++-- .../v2016_02_01/operations/_operations.py | 144 +++--- .../_resource_management_client.py | 20 +- .../resource/resources/v2016_09_01/_vendor.py | 14 - .../resources/v2016_09_01/_version.py | 2 +- .../aio/_resource_management_client.py | 20 +- .../v2016_09_01/aio/operations/_operations.py | 74 ++-- .../v2016_09_01/operations/_operations.py | 154 +++---- .../_resource_management_client.py | 20 +- .../resource/resources/v2017_05_10/_vendor.py | 14 - .../resources/v2017_05_10/_version.py | 2 +- .../aio/_resource_management_client.py | 20 +- .../v2017_05_10/aio/operations/_operations.py | 78 ++-- .../v2017_05_10/operations/_operations.py | 160 +++---- .../_resource_management_client.py | 20 +- .../resource/resources/v2018_02_01/_vendor.py | 14 - .../resources/v2018_02_01/_version.py | 2 +- .../aio/_resource_management_client.py | 20 +- .../v2018_02_01/aio/operations/_operations.py | 78 ++-- .../v2018_02_01/operations/_operations.py | 160 +++---- .../_resource_management_client.py | 22 +- .../resource/resources/v2018_05_01/_vendor.py | 14 - .../resources/v2018_05_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2018_05_01/aio/operations/_operations.py | 105 ++--- .../v2018_05_01/operations/_operations.py | 207 ++++----- .../_resource_management_client.py | 22 +- .../resource/resources/v2019_03_01/_vendor.py | 14 - .../resources/v2019_03_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_03_01/aio/operations/_operations.py | 105 ++--- .../v2019_03_01/operations/_operations.py | 207 ++++----- .../_resource_management_client.py | 22 +- .../resource/resources/v2019_05_01/_vendor.py | 14 - .../resources/v2019_05_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_05_01/aio/operations/_operations.py | 129 +++--- .../v2019_05_01/operations/_operations.py | 251 +++++------ .../_resource_management_client.py | 22 +- .../resource/resources/v2019_05_10/_vendor.py | 14 - .../resources/v2019_05_10/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_05_10/aio/operations/_operations.py | 133 +++--- .../v2019_05_10/operations/_operations.py | 257 +++++------ .../_resource_management_client.py | 22 +- .../resource/resources/v2019_07_01/_vendor.py | 14 - .../resources/v2019_07_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_07_01/aio/operations/_operations.py | 189 ++++---- .../v2019_07_01/operations/_operations.py | 355 +++++++-------- .../_resource_management_client.py | 22 +- .../resource/resources/v2019_08_01/_vendor.py | 14 - .../resources/v2019_08_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_08_01/aio/operations/_operations.py | 191 ++++---- .../v2019_08_01/operations/_operations.py | 357 +++++++-------- .../_resource_management_client.py | 22 +- .../resource/resources/v2019_10_01/_vendor.py | 14 - .../resources/v2019_10_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2019_10_01/aio/operations/_operations.py | 217 ++++----- .../v2019_10_01/operations/_operations.py | 395 +++++++++-------- .../_resource_management_client.py | 22 +- .../resource/resources/v2020_06_01/_vendor.py | 14 - .../resources/v2020_06_01/_version.py | 2 +- .../aio/_resource_management_client.py | 22 +- .../v2020_06_01/aio/operations/_operations.py | 219 ++++----- .../v2020_06_01/operations/_operations.py | 399 ++++++++--------- .../_resource_management_client.py | 24 +- .../resource/resources/v2020_10_01/_vendor.py | 14 - .../resources/v2020_10_01/_version.py | 2 +- .../aio/_resource_management_client.py | 24 +- .../v2020_10_01/aio/operations/_operations.py | 222 +++++----- .../v2020_10_01/operations/_operations.py | 404 ++++++++--------- .../_resource_management_client.py | 24 +- .../resource/resources/v2021_01_01/_vendor.py | 14 - .../resources/v2021_01_01/_version.py | 2 +- .../aio/_resource_management_client.py | 24 +- .../v2021_01_01/aio/operations/_operations.py | 222 +++++----- .../v2021_01_01/operations/_operations.py | 404 ++++++++--------- .../_resource_management_client.py | 24 +- .../resource/resources/v2021_04_01/_vendor.py | 14 - .../resources/v2021_04_01/_version.py | 2 +- .../aio/_resource_management_client.py | 24 +- .../v2021_04_01/aio/operations/_operations.py | 224 +++++----- .../v2021_04_01/operations/_operations.py | 408 ++++++++--------- .../_resource_management_client.py | 24 +- .../resource/resources/v2022_09_01/_vendor.py | 14 - .../resources/v2022_09_01/_version.py | 2 +- .../aio/_resource_management_client.py | 24 +- .../v2022_09_01/aio/operations/_operations.py | 230 +++++----- .../resources/v2022_09_01/models/__init__.py | 6 + .../v2022_09_01/models/_models_py3.py | 126 +++++- .../v2022_09_01/operations/_operations.py | 414 +++++++++--------- .../resource/subscriptions/_serialization.py | 30 +- .../subscriptions/_subscription_client.py | 8 +- .../subscriptions/aio/_subscription_client.py | 8 +- .../v2016_06_01/_subscription_client.py | 8 +- .../subscriptions/v2016_06_01/_vendor.py | 14 +- .../subscriptions/v2016_06_01/_version.py | 2 +- .../v2016_06_01/aio/_subscription_client.py | 8 +- .../v2016_06_01/aio/operations/_operations.py | 25 +- .../v2016_06_01/operations/_operations.py | 33 +- .../v2018_06_01/_subscription_client.py | 8 +- .../subscriptions/v2018_06_01/_vendor.py | 14 +- .../subscriptions/v2018_06_01/_version.py | 2 +- .../v2018_06_01/aio/_subscription_client.py | 8 +- .../v2018_06_01/aio/operations/_operations.py | 25 +- .../v2018_06_01/operations/_operations.py | 33 +- .../v2019_06_01/_subscription_client.py | 8 +- .../subscriptions/v2019_06_01/_vendor.py | 14 +- .../subscriptions/v2019_06_01/_version.py | 2 +- .../v2019_06_01/aio/_subscription_client.py | 8 +- .../v2019_06_01/aio/operations/_operations.py | 25 +- .../v2019_06_01/operations/_operations.py | 33 +- .../v2019_11_01/_subscription_client.py | 8 +- .../subscriptions/v2019_11_01/_vendor.py | 14 +- .../subscriptions/v2019_11_01/_version.py | 2 +- .../v2019_11_01/aio/_subscription_client.py | 8 +- .../v2019_11_01/aio/operations/_operations.py | 25 +- .../v2019_11_01/operations/_operations.py | 33 +- .../v2021_01_01/_subscription_client.py | 6 +- .../subscriptions/v2021_01_01/_vendor.py | 14 +- .../subscriptions/v2021_01_01/_version.py | 2 +- .../v2021_01_01/aio/_subscription_client.py | 6 +- .../v2021_01_01/aio/operations/_operations.py | 22 +- .../v2021_01_01/operations/_operations.py | 30 +- .../v2022_12_01/_subscription_client.py | 8 +- .../subscriptions/v2022_12_01/_vendor.py | 14 +- .../subscriptions/v2022_12_01/_version.py | 2 +- .../v2022_12_01/aio/_subscription_client.py | 8 +- .../v2022_12_01/aio/operations/_operations.py | 25 +- .../v2022_12_01/operations/_operations.py | 33 +- .../resource/templatespecs/_serialization.py | 30 +- .../templatespecs/_template_specs_client.py | 6 +- .../aio/_template_specs_client.py | 6 +- .../_template_specs_client.py | 6 +- .../v2019_06_01_preview/_vendor.py | 14 - .../v2019_06_01_preview/_version.py | 2 +- .../aio/_template_specs_client.py | 6 +- .../aio/operations/_operations.py | 46 +- .../operations/_operations.py | 70 ++- .../_template_specs_client.py | 6 +- .../v2021_03_01_preview/_vendor.py | 14 - .../v2021_03_01_preview/_version.py | 2 +- .../aio/_template_specs_client.py | 6 +- .../aio/operations/_operations.py | 46 +- .../operations/_operations.py | 70 ++- .../v2021_05_01/_template_specs_client.py | 6 +- .../templatespecs/v2021_05_01/_vendor.py | 14 - .../templatespecs/v2021_05_01/_version.py | 2 +- .../v2021_05_01/aio/_template_specs_client.py | 6 +- .../v2021_05_01/aio/operations/_operations.py | 24 +- .../v2021_05_01/operations/_operations.py | 48 +- .../v2022_02_01/_template_specs_client.py | 6 +- .../templatespecs/v2022_02_01/_vendor.py | 14 - .../templatespecs/v2022_02_01/_version.py | 2 +- .../v2022_02_01/aio/_template_specs_client.py | 6 +- .../v2022_02_01/aio/operations/_operations.py | 32 +- .../v2022_02_01/operations/_operations.py | 62 +-- 351 files changed, 7368 insertions(+), 6396 deletions(-) diff --git a/sdk/resources/azure-mgmt-resource/_meta.json b/sdk/resources/azure-mgmt-resource/_meta.json index e19f4cc7074de..1452c7d4e7db5 100644 --- a/sdk/resources/azure-mgmt-resource/_meta.json +++ b/sdk/resources/azure-mgmt-resource/_meta.json @@ -1,11 +1,63 @@ { - "commit": "7211edbf5b76865549fcfaf35942cd50484fed74", + "commit": "48a17e12cda90cd680997c5d3b479369941840fc", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.5.0", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/resources/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.5.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", - "readme": "specification/resources/resource-manager/readme.md" + "autorest_command": "autorest specification/resources/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", + "readme": "specification/resources/resource-manager/readme.md", + "package-privatelinks-2020-05": "2022-03-18 16:14:07 -0700 2c68b6f0c9566d97d9d590a31b0d46997622eef7 Microsoft.Authorization/stable/2020-05-01/privateLinks.json", + "package-features-2021-07": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Features/stable/2021-07-01/features.json", + "package-features-2015-12": "2020-03-23 19:43:44 -0700 53dd5c1278de960b38ea5cbdf69be99d4d4bfd0f Microsoft.Features/stable/2015-12-01/features.json", + "package-links-2016-09": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Resources/stable/2016-09-01/links.json", + "package-locks-2016-09": "2021-03-16 20:01:32 -0700 be1d938d548060ffe4dea422b32a6932b168ec18 Microsoft.Authorization/stable/2016-09-01/locks.json", + "package-locks-2015-01": "2018-06-04 10:10:25 -0700 a9675b1e5a9b0e694bea4e417365f74657b8903a Microsoft.Authorization/stable/2015-01-01/locks.json", + "package-managedapplications-2019-07": "2022-02-17 23:42:24 -0800 67223eb5be65114df664bb5ae28e6e14ff62e84f Microsoft.Solutions/stable/2019-07-01/managedapplications.json", + "package-policy-2022-08-preview-only": "2022-11-15 18:35:20 -0800 fa7609844bc20b126037dfb180ef7155c2174f7b Microsoft.Authorization/preview/2022-08-01-preview/policyVariables.json", + "package-policy-2022-07-preview-only": "2022-10-10 18:10:12 -0700 1cb05f075f2d061686fa8a9e45c72d1fafff9e3f Microsoft.Authorization/preview/2022-07-01-preview/policyExemptions.json", + "package-policy-2022-06-only": "2022-10-10 18:10:12 -0700 1cb05f075f2d061686fa8a9e45c72d1fafff9e3f Microsoft.Authorization/stable/2022-06-01/policyAssignments.json", + "package-policy-2021-06-only": "2022-11-15 18:35:20 -0800 fa7609844bc20b126037dfb180ef7155c2174f7b Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json", + "package-policy-2020-09-only": "2022-11-15 18:35:20 -0800 fa7609844bc20b126037dfb180ef7155c2174f7b Microsoft.Authorization/stable/2020-09-01/dataPolicyManifests.json", + "package-policy-2020-07-preview-only": "2021-02-01 17:30:20 -0800 76fb4a0f3187990b6cc487a9b45ce7e37dd479a6 Microsoft.Authorization/preview/2020-07-01-preview/policyExemptions.json", + "package-policy-2019-09": "2020-01-12 18:45:11 -0800 d960c6cfad5edcd47d7573d935ff0bd7f6bdfe04 Microsoft.Authorization/stable/2019-09-01/policyAssignments.json", + "package-policy-2019-06": "2019-08-28 02:16:00 -0400 35b484b592948aa81f9c95d2ec7425cf08fd15a2 Microsoft.Authorization/stable/2019-06-01/policyAssignments.json", + "package-policy-2019-01": "2019-07-11 14:36:23 -0400 568b944dd2b19b35b7c06f917d0166c046a85851 Microsoft.Authorization/stable/2019-01-01/policySetDefinitions.json", + "package-policy-2018-05": "2019-07-04 18:31:46 -0700 f6e96392dd7f1069b6d600cfda549bf786d009b0 Microsoft.Authorization/stable/2018-05-01/policyAssignments.json", + "package-policy-2018-03": "2019-07-04 18:31:46 -0700 f6e96392dd7f1069b6d600cfda549bf786d009b0 Microsoft.Authorization/stable/2018-03-01/policyAssignments.json", + "package-policy-2017-06-preview-only": "2019-06-12 19:24:50 -0400 c7a6b470d7bb65a240739e99a4d123ed1a3ca7e9 Microsoft.Authorization/preview/2017-06-01-preview/policySetDefinitions.json", + "package-policy-2016-12": "2019-06-12 19:24:50 -0400 c7a6b470d7bb65a240739e99a4d123ed1a3ca7e9 Microsoft.Authorization/stable/2016-12-01/policyAssignments.json", + "package-policy-2016-04": "2018-12-10 12:22:37 -0500 3a0278ee2f92ca2fbb5c6bedf54607133bd4f8be Microsoft.Authorization/stable/2016-04-01/policy.json", + "package-policy-2015-10": "2018-12-10 12:22:37 -0500 3a0278ee2f92ca2fbb5c6bedf54607133bd4f8be Microsoft.Authorization/preview/2015-10-01-preview/policy.json", + "package-resources-2022-09": "2023-06-14 18:50:13 -0700 49401294370eed6ed25de57fce89ac901c671cf4 Microsoft.Resources/stable/2022-09-01/resources.json", + "package-resources-2021-04": "2022-08-21 21:31:53 -0700 81cd88a080c4bf4bb251afbe62892a6e220cb2b4 Microsoft.Resources/stable/2021-04-01/resources.json", + "package-resources-2021-01": "2021-12-05 18:06:52 -0800 3b2f85d320fac5b282bc80240f9e5c2c57753bad Microsoft.Resources/stable/2021-01-01/resources.json", + "package-resources-2020-10": "2021-10-07 18:41:27 -0700 23b8c3e5ecc0a90bc89f93517d7f45ca0b6881d5 Microsoft.Resources/stable/2020-10-01/resources.json", + "package-resources-2020-06": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Resources/stable/2020-06-01/resources.json", + "package-resources-2019-10": "2021-10-07 18:41:27 -0700 23b8c3e5ecc0a90bc89f93517d7f45ca0b6881d5 Microsoft.Resources/stable/2019-10-01/resources.json", + "package-resources-2019-08": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2019-08-01/resources.json", + "package-resources-2019-07": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2019-07-01/resources.json", + "package-resources-2019-0510": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2019-05-10/resources.json", + "package-resources-2019-05": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2019-05-10/resources.json", + "package-resources-2019-03": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2019-03-01/resources.json", + "package-resources-2018-05": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2018-05-01/resources.json", + "package-resources-2018-02": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2018-02-01/resources.json", + "package-resources-2017-05": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2017-05-10/resources.json", + "package-resources-2016-09": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2016-09-01/resources.json", + "package-resources-2016-02": "2022-03-31 18:32:58 -0700 d55f30f41f04e712de101fc9c17a591ca410bfed Microsoft.Resources/stable/2016-02-01/resources.json", + "package-subscriptions-2022-12": "2023-05-23 14:08:27 +0800 c183bb012de8e9e1d0d2e67a0994748df4747d2c Microsoft.Resources/stable/2022-12-01/subscriptions.json", + "package-subscriptions-2021-01": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Resources/stable/2021-01-01/subscriptions.json", + "package-subscriptions-2019-11": "2022-01-11 17:53:40 -0800 5d117a8c7686fe2b2940114f6866a3958ccca6e0 Microsoft.Resources/stable/2019-11-01/subscriptions.json", + "package-subscriptions-2019-06": "2022-01-11 17:53:40 -0800 5d117a8c7686fe2b2940114f6866a3958ccca6e0 Microsoft.Resources/stable/2019-06-01/subscriptions.json", + "package-subscriptions-2018-06": "2022-01-11 17:53:40 -0800 5d117a8c7686fe2b2940114f6866a3958ccca6e0 Microsoft.Resources/stable/2018-06-01/subscriptions.json", + "package-subscriptions-2016-06": "2022-01-11 17:53:40 -0800 5d117a8c7686fe2b2940114f6866a3958ccca6e0 Microsoft.Resources/stable/2016-06-01/subscriptions.json", + "package-deploymentscripts-2020-10": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Resources/stable/2020-10-01/deploymentScripts.json", + "package-deploymentscripts-2019-10-preview": "2021-03-02 01:33:38 -0800 61fa39c7434b2058085bd10c4d66877db5d7f5c7 Microsoft.Resources/preview/2019-10-01-preview/deploymentScripts.json", + "package-templatespecs-2022-02": "2022-04-18 03:28:00 -0700 f5b15e812e6e5228eaebf3b629a682a088afebd6 Microsoft.Resources/stable/2022-02-01/templateSpecs.json", + "package-templatespecs-2021-05": "2022-03-06 17:36:42 -0800 6a57e9cedc87cafd2dc9e4f3e8af62b5725e3d22 Microsoft.Resources/stable/2021-05-01/templateSpecs.json", + "package-templatespecs-2021-03-preview": "2021-04-08 22:14:47 -0700 02014ccbf8f7e4ae156713583252c9492b540527 Microsoft.Resources/preview/2021-03-01-preview/templateSpecs.json", + "package-templatespecs-2019-06-preview": "2020-10-19 17:06:28 -0700 86d04dae5f34cbe19217e546cbc14d67664c7124 Microsoft.Resources/preview/2019-06-01-preview/templateSpecs.json", + "package-deploymentstacks-2022-08-preview": "2023-05-30 01:27:13 -0400 13bf172f804ad5546ad3ccdf0c785777d4f15825 Microsoft.Resources/preview/2022-08-01-preview/deploymentStacks.json", + "package-changes-2022-05": "2022-04-24 21:43:30 -0700 91b36e26db23dffc149d968333c29f9a2f131702 Microsoft.Resources/stable/2022-05-01/changes.json" } \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py index a947505955cc3..76231cba71582 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_changes_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ChangesClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ChangesClient, self).__init__( @@ -104,7 +106,7 @@ def changes(self): else: raise ValueError("API version {} does not have operation group 'changes'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py index 662cda295ccec..11408ef19531d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/aio/_changes_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ChangesClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ChangesClient, self).__init__( @@ -104,7 +106,7 @@ def changes(self): else: raise ValueError("API version {} does not have operation group 'changes'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py index 9406fce1d9ee1..d819716fdb546 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_changes_client.py @@ -53,7 +53,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize, "2022-05-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py index 1b43918bf281f..407654d4899e5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/_changes_client.py @@ -53,7 +53,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize) + self.changes = ChangesOperations(self._client, self._config, self._serialize, self._deserialize, "2022-05-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py index 57960e990bae2..d5585ed1e5003 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/aio/operations/_operations.py @@ -52,6 +52,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -88,7 +89,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01")) cls: ClsType[_models.ChangeResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -203,7 +204,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01")) cls: ClsType[_models.ChangeResourceResult] = kwargs.pop("cls", None) request = build_changes_get_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py index e716cc4bcbf6f..ccb5aaed0a193 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/changes/v2022_05_01/operations/_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +66,7 @@ def build_changes_list_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_changes_get_request( "changeResourceId": _SERIALIZER.url("change_resource_id", change_resource_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -139,6 +139,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -175,7 +176,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01")) cls: ClsType[_models.ChangeResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -290,7 +291,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-05-01")) cls: ClsType[_models.ChangeResourceResult] = kwargs.pop("cls", None) request = build_changes_get_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py index 2d0d13460ed32..afd64af43e5a0 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_deployment_scripts_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = DeploymentScriptsClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DeploymentScriptsClient, self).__init__( @@ -112,7 +114,7 @@ def deployment_scripts(self): else: raise ValueError("API version {} does not have operation group 'deployment_scripts'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/aio/_deployment_scripts_client.py index 1147741848f96..edb66c640b4e8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/aio/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/aio/_deployment_scripts_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = DeploymentScriptsClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DeploymentScriptsClient, self).__init__( @@ -112,7 +114,7 @@ def deployment_scripts(self): else: raise ValueError("API version {} does not have operation group 'deployment_scripts'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py index c74004aecc13e..ae19a5d93cd72 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_deployment_scripts_client.py @@ -60,7 +60,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_scripts = DeploymentScriptsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-10-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py index 729674f5b2d7b..63b2694bd4774 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/_deployment_scripts_client.py @@ -60,7 +60,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_scripts = DeploymentScriptsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-10-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py index 351a9c6b8f897..ea8cb67e64ef8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/aio/operations/_operations.py @@ -64,6 +64,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _create_initial( self, @@ -83,7 +84,9 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -251,7 +254,9 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -394,7 +399,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -472,7 +479,9 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) request = build_deployment_scripts_get_request( @@ -538,7 +547,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_scripts_delete_request( @@ -585,7 +596,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { @@ -681,7 +694,9 @@ async def get_logs(self, resource_group_name: str, script_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.ScriptLogsList] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_request( @@ -750,7 +765,9 @@ async def get_logs_default( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.ScriptLog] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_default_request( @@ -807,7 +824,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py index db1da239fd1ac..632c1e322d960 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2019_10_01_preview/operations/_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_deployment_scripts_create_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +98,7 @@ def build_deployment_scripts_update_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,7 +133,7 @@ def build_deployment_scripts_get_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -166,7 +166,7 @@ def build_deployment_scripts_delete_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +190,7 @@ def build_deployment_scripts_list_by_subscription_request(subscription_id: str, "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -223,7 +223,7 @@ def build_deployment_scripts_get_logs_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,7 +256,7 @@ def build_deployment_scripts_get_logs_default_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,7 +290,7 @@ def build_deployment_scripts_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -319,6 +319,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _create_initial( self, @@ -338,7 +339,9 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -506,7 +509,9 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -649,7 +654,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -727,7 +734,9 @@ def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) request = build_deployment_scripts_get_request( @@ -793,7 +802,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_scripts_delete_request( @@ -840,7 +851,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScr _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { @@ -936,7 +949,9 @@ def get_logs(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.ScriptLogsList] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_request( @@ -1005,7 +1020,9 @@ def get_logs_default( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.ScriptLog] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_default_request( @@ -1060,7 +1077,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-10-01-preview") + ) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py index cdcdafc494512..b5755d967e015 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_deployment_scripts_client.py @@ -60,7 +60,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_scripts = DeploymentScriptsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py index abcc4728bcc10..ddd40a2abda52 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/_deployment_scripts_client.py @@ -60,7 +60,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_scripts = DeploymentScriptsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py index 04706499b2575..edc779cdf227c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/aio/operations/_operations.py @@ -64,6 +64,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _create_initial( self, @@ -83,7 +84,7 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -251,7 +252,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -393,7 +394,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -471,7 +472,7 @@ async def get(self, resource_group_name: str, script_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) request = build_deployment_scripts_get_request( @@ -537,7 +538,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_scripts_delete_request( @@ -584,7 +585,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { @@ -680,7 +681,7 @@ async def get_logs(self, resource_group_name: str, script_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ScriptLogsList] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_request( @@ -749,7 +750,7 @@ async def get_logs_default( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ScriptLog] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_default_request( @@ -806,7 +807,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py index f44475e042293..daaa24dd8bc0a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentscripts/v2020_10_01/operations/_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_deployment_scripts_create_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +98,7 @@ def build_deployment_scripts_update_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,7 +133,7 @@ def build_deployment_scripts_get_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -166,7 +166,7 @@ def build_deployment_scripts_delete_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +190,7 @@ def build_deployment_scripts_list_by_subscription_request(subscription_id: str, "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -223,7 +223,7 @@ def build_deployment_scripts_get_logs_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,7 +256,7 @@ def build_deployment_scripts_get_logs_default_request( "scriptName": _SERIALIZER.url("script_name", script_name, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,7 +290,7 @@ def build_deployment_scripts_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -319,6 +319,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _create_initial( self, @@ -338,7 +339,7 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -506,7 +507,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -648,7 +649,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) @@ -726,7 +727,7 @@ def get(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScript] = kwargs.pop("cls", None) request = build_deployment_scripts_get_request( @@ -792,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_scripts_delete_request( @@ -839,7 +840,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentScr _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { @@ -935,7 +936,7 @@ def get_logs(self, resource_group_name: str, script_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ScriptLogsList] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_request( @@ -1004,7 +1005,7 @@ def get_logs_default( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ScriptLog] = kwargs.pop("cls", None) request = build_deployment_scripts_get_logs_default_request( @@ -1059,7 +1060,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentScriptListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_deployment_stacks_client.py index abe248f19e171..962b9657dc71a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_deployment_stacks_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_deployment_stacks_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = DeploymentStacksClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DeploymentStacksClient, self).__init__( @@ -105,7 +107,7 @@ def deployment_stacks(self): else: raise ValueError("API version {} does not have operation group 'deployment_stacks'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/aio/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/aio/_deployment_stacks_client.py index d644121d227eb..aa326aad687ee 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/aio/_deployment_stacks_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/aio/_deployment_stacks_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = DeploymentStacksClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(DeploymentStacksClient, self).__init__( @@ -105,7 +107,7 @@ def deployment_stacks(self): else: raise ValueError("API version {} does not have operation group 'deployment_stacks'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py index b628b340859aa..eab7615c301a7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_deployment_stacks_client.py @@ -59,7 +59,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_stacks = DeploymentStacksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py index 01f413fa4d2a7..21b167a6ba853 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/_deployment_stacks_client.py @@ -59,7 +59,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.deployment_stacks = DeploymentStacksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py index 53d5d2fe10ed1..9e10ed5b44df4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/aio/operations/_operations.py @@ -71,6 +71,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_at_resource_group( @@ -90,7 +91,9 @@ def list_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -175,7 +178,9 @@ def list_at_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Deployme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -263,7 +268,9 @@ def list_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -352,7 +359,9 @@ async def _create_or_update_at_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -520,7 +529,9 @@ async def begin_create_or_update_at_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -595,7 +606,9 @@ async def get_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_resource_group_request( @@ -652,7 +665,9 @@ async def _delete_at_resource_group_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_resource_group_request( @@ -732,7 +747,9 @@ async def begin_delete_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -790,7 +807,9 @@ async def _create_or_update_at_subscription_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -937,7 +956,9 @@ async def begin_create_or_update_at_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1006,7 +1027,9 @@ async def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_subscription_request( @@ -1061,7 +1084,9 @@ async def _delete_at_subscription_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_subscription_request( @@ -1136,7 +1161,9 @@ async def begin_delete_at_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1197,7 +1224,9 @@ async def _create_or_update_at_management_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -1361,7 +1390,9 @@ async def begin_create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1435,7 +1466,9 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_management_group_request( @@ -1492,7 +1525,9 @@ async def _delete_at_management_group_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_management_group_request( @@ -1576,7 +1611,9 @@ async def begin_delete_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1649,7 +1686,9 @@ async def export_template_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_resource_group_request( @@ -1712,7 +1751,9 @@ async def export_template_at_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_subscription_request( @@ -1776,7 +1817,9 @@ async def export_template_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_management_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py index 7828448d6c913..732477aadc251 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/deploymentstacks/v2022_08_01_preview/operations/_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +60,7 @@ def build_deployment_stacks_list_at_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,7 +84,7 @@ def build_deployment_stacks_list_at_subscription_request(subscription_id: str, * "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,7 +113,7 @@ def build_deployment_stacks_list_at_management_group_request(management_group_id ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,7 +154,7 @@ def build_deployment_stacks_create_or_update_at_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,7 +196,7 @@ def build_deployment_stacks_get_at_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,7 +242,7 @@ def build_deployment_stacks_delete_at_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if unmanage_action_resources is not None: @@ -288,7 +288,7 @@ def build_deployment_stacks_create_or_update_at_subscription_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -327,7 +327,7 @@ def build_deployment_stacks_get_at_subscription_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -369,7 +369,7 @@ def build_deployment_stacks_delete_at_subscription_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if unmanage_action_resources is not None: @@ -417,7 +417,7 @@ def build_deployment_stacks_create_or_update_at_management_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +458,7 @@ def build_deployment_stacks_get_at_management_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -503,7 +503,7 @@ def build_deployment_stacks_delete_at_management_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if unmanage_action_resources is not None: @@ -555,7 +555,7 @@ def build_deployment_stacks_export_template_at_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -592,7 +592,7 @@ def build_deployment_stacks_export_template_at_subscription_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -631,7 +631,7 @@ def build_deployment_stacks_export_template_at_management_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -660,6 +660,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_at_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.DeploymentStack"]: @@ -677,7 +678,9 @@ def list_at_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -762,7 +765,9 @@ def list_at_subscription(self, **kwargs: Any) -> Iterable["_models.DeploymentSta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -848,7 +853,9 @@ def list_at_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackListResult] = kwargs.pop("cls", None) error_map = { @@ -937,7 +944,9 @@ def _create_or_update_at_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -1105,7 +1114,9 @@ def begin_create_or_update_at_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1179,7 +1190,9 @@ def get_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_resource_group_request( @@ -1236,7 +1249,9 @@ def _delete_at_resource_group_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_resource_group_request( @@ -1316,7 +1331,9 @@ def begin_delete_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1374,7 +1391,9 @@ def _create_or_update_at_subscription_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -1521,7 +1540,9 @@ def begin_create_or_update_at_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1589,7 +1610,9 @@ def get_at_subscription(self, deployment_stack_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_subscription_request( @@ -1644,7 +1667,9 @@ def _delete_at_subscription_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_subscription_request( @@ -1719,7 +1744,9 @@ def begin_delete_at_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1780,7 +1807,9 @@ def _create_or_update_at_management_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) @@ -1944,7 +1973,9 @@ def begin_create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2017,7 +2048,9 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStack] = kwargs.pop("cls", None) request = build_deployment_stacks_get_at_management_group_request( @@ -2074,7 +2107,9 @@ def _delete_at_management_group_initial( # pylint: disable=inconsistent-return- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployment_stacks_delete_at_management_group_request( @@ -2158,7 +2193,9 @@ def begin_delete_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2231,7 +2268,9 @@ def export_template_at_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_resource_group_request( @@ -2294,7 +2333,9 @@ def export_template_at_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_subscription_request( @@ -2358,7 +2399,9 @@ def export_template_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.DeploymentStackTemplateDefinition] = kwargs.pop("cls", None) request = build_deployment_stacks_export_template_at_management_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_feature_client.py index bd725a3f155dc..4290c26696269 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_feature_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = FeatureClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(FeatureClient, self).__init__( @@ -112,7 +114,7 @@ def features(self): else: raise ValueError("API version {} does not have operation group 'features'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def subscription_feature_registrations(self): @@ -126,7 +128,7 @@ def subscription_feature_registrations(self): else: raise ValueError("API version {} does not have operation group 'subscription_feature_registrations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_feature_client.py index 0a572949c8fef..505734f8b4db1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/aio/_feature_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = FeatureClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(FeatureClient, self).__init__( @@ -112,7 +114,7 @@ def features(self): else: raise ValueError("API version {} does not have operation group 'features'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def subscription_feature_registrations(self): @@ -126,7 +128,7 @@ def subscription_feature_registrations(self): else: raise ValueError("API version {} does not have operation group 'subscription_feature_registrations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py index b66ac6d5fadf8..4878c44ac8b7d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_feature_client.py @@ -55,7 +55,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) + self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize, "2015-12-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py index 3b7da72b39ac7..86437fa4b9fdc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class FeatureClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py index baa2b0e9f8421..b1ac6c1f7f93b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/_feature_client.py @@ -55,7 +55,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) + self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize, "2015-12-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py index 84909c22aa54e..6ae3c189d508c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/aio/operations/_operations.py @@ -43,6 +43,12 @@ class FeatureClientOperationsMixin(FeatureClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """Lists all of the available Microsoft.Features REST API operations. @@ -56,7 +62,9 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2015-12-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -142,6 +150,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]: @@ -156,7 +165,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -241,7 +250,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -336,7 +345,7 @@ async def get(self, resource_provider_namespace: str, feature_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_get_request( @@ -399,7 +408,7 @@ async def register( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_register_request( @@ -462,7 +471,7 @@ async def unregister( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_unregister_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py index b3625f075ecf7..369c0461c5331 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/operations/_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import FeatureClientMixinABC, _convert_request, _format_url_section +from .._vendor import FeatureClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +68,7 @@ def build_features_list_all_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,7 +96,7 @@ def build_features_list_request(resource_provider_namespace: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,7 +127,7 @@ def build_features_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,7 +158,7 @@ def build_features_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -189,7 +189,7 @@ def build_features_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -201,6 +201,12 @@ def build_features_unregister_request( class FeatureClientOperationsMixin(FeatureClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """Lists all of the available Microsoft.Features REST API operations. @@ -214,7 +220,9 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2015-12-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -300,6 +308,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]: @@ -314,7 +323,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -399,7 +408,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -494,7 +503,7 @@ def get(self, resource_provider_namespace: str, feature_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_get_request( @@ -555,7 +564,7 @@ def register(self, resource_provider_namespace: str, feature_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_register_request( @@ -616,7 +625,7 @@ def unregister(self, resource_provider_namespace: str, feature_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-12-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_unregister_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py index 7bf28cbdd5d90..5af831e9e567e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_feature_client.py @@ -58,9 +58,9 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) + self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-07-01") self.subscription_feature_registrations = SubscriptionFeatureRegistrationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-07-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py index 3b7da72b39ac7..86437fa4b9fdc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class FeatureClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py index 761eba8c7cbe0..86a1696103a16 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/_feature_client.py @@ -58,9 +58,9 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize) + self.features = FeaturesOperations(self._client, self._config, self._serialize, self._deserialize, "2021-07-01") self.subscription_feature_registrations = SubscriptionFeatureRegistrationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-07-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py index c495a5d0c8e29..b438d717858dc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/aio/operations/_operations.py @@ -49,6 +49,12 @@ class FeatureClientOperationsMixin(FeatureClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """Lists all of the available Microsoft.Features REST API operations. @@ -62,7 +68,9 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2021-07-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -149,6 +157,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]: @@ -163,7 +172,7 @@ def list_all(self, **kwargs: Any) -> AsyncIterable["_models.FeatureResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -249,7 +258,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -345,7 +354,7 @@ async def get(self, resource_provider_namespace: str, feature_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_get_request( @@ -409,7 +418,7 @@ async def register( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_register_request( @@ -473,7 +482,7 @@ async def unregister( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_unregister_request( @@ -530,6 +539,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -557,7 +567,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistration] = kwargs.pop("cls", None) request = build_subscription_feature_registrations_get_request( @@ -689,7 +699,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SubscriptionFeatureRegistration] = kwargs.pop("cls", None) @@ -768,7 +778,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_subscription_feature_registrations_delete_request( @@ -820,7 +830,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None) error_map = { @@ -906,7 +916,7 @@ def list_all_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Subs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py index 3f90ba9d17833..d3b4b35a0e2ff 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import FeatureClientMixinABC, _convert_request, _format_url_section +from .._vendor import FeatureClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +69,7 @@ def build_features_list_all_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +97,7 @@ def build_features_list_request(resource_provider_namespace: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +128,7 @@ def build_features_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,7 +159,7 @@ def build_features_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,7 +190,7 @@ def build_features_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -221,7 +221,7 @@ def build_subscription_feature_registrations_get_request( "featureName": _SERIALIZER.url("feature_name", feature_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -253,7 +253,7 @@ def build_subscription_feature_registrations_create_or_update_request( "featureName": _SERIALIZER.url("feature_name", feature_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -286,7 +286,7 @@ def build_subscription_feature_registrations_delete_request( "featureName": _SERIALIZER.url("feature_name", feature_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -316,7 +316,7 @@ def build_subscription_feature_registrations_list_by_subscription_request( "providerNamespace": _SERIALIZER.url("provider_namespace", provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -344,7 +344,7 @@ def build_subscription_feature_registrations_list_all_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -356,6 +356,12 @@ def build_subscription_feature_registrations_list_all_by_subscription_request( class FeatureClientOperationsMixin(FeatureClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """Lists all of the available Microsoft.Features REST API operations. @@ -369,7 +375,9 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2021-07-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -456,6 +464,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]: @@ -470,7 +479,7 @@ def list_all(self, **kwargs: Any) -> Iterable["_models.FeatureResult"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -556,7 +565,7 @@ def list(self, resource_provider_namespace: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -652,7 +661,7 @@ def get(self, resource_provider_namespace: str, feature_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_get_request( @@ -714,7 +723,7 @@ def register(self, resource_provider_namespace: str, feature_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_register_request( @@ -776,7 +785,7 @@ def unregister(self, resource_provider_namespace: str, feature_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.FeatureResult] = kwargs.pop("cls", None) request = build_features_unregister_request( @@ -833,6 +842,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get(self, provider_namespace: str, feature_name: str, **kwargs: Any) -> _models.SubscriptionFeatureRegistration: @@ -858,7 +868,7 @@ def get(self, provider_namespace: str, feature_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistration] = kwargs.pop("cls", None) request = build_subscription_feature_registrations_get_request( @@ -990,7 +1000,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SubscriptionFeatureRegistration] = kwargs.pop("cls", None) @@ -1069,7 +1079,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_subscription_feature_registrations_delete_request( @@ -1121,7 +1131,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None) error_map = { @@ -1207,7 +1217,7 @@ def list_all_by_subscription(self, **kwargs: Any) -> Iterable["_models.Subscript _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.SubscriptionFeatureRegistrationList] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_management_link_client.py index 99a603591bcee..e14490ebbd381 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_management_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_management_link_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ManagementLinkClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ManagementLinkClient, self).__init__( @@ -104,7 +106,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_links(self): @@ -118,7 +120,7 @@ def resource_links(self): else: raise ValueError("API version {} does not have operation group 'resource_links'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/aio/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/aio/_management_link_client.py index 4f40ed408263d..7aa14b7aa38f3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/aio/_management_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/aio/_management_link_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ManagementLinkClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ManagementLinkClient, self).__init__( @@ -104,7 +106,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_links(self): @@ -118,7 +120,7 @@ def resource_links(self): else: raise ValueError("API version {} does not have operation group 'resource_links'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py index cc634e4ed7e3d..2f78f214da777 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_management_link_client.py @@ -60,8 +60,10 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.resource_links = ResourceLinksOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2016-09-01") + self.resource_links = ResourceLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py index e8a993d9f3c9f..28ca3989d8363 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/_management_link_client.py @@ -60,8 +60,10 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.resource_links = ResourceLinksOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2016-09-01") + self.resource_links = ResourceLinksOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py index 591776d0c7add..2dc0fb45e79fc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/aio/operations/_operations.py @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -79,7 +80,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -165,6 +166,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -192,7 +194,7 @@ async def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable= _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_links_delete_request( @@ -301,7 +303,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceLink] = kwargs.pop("cls", None) @@ -374,7 +376,7 @@ async def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLink] = kwargs.pop("cls", None) request = build_resource_links_get_request( @@ -426,7 +428,7 @@ def list_at_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None) error_map = { @@ -518,7 +520,7 @@ def list_at_source_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py index 5170211c21acf..50e4a66bc8bec 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/operations/_operations.py @@ -29,7 +29,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 8): from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports @@ -71,7 +71,7 @@ def build_resource_links_delete_request(link_id: str, **kwargs: Any) -> HttpRequ "linkId": _SERIALIZER.url("link_id", link_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +93,7 @@ def build_resource_links_create_or_update_request(link_id: str, **kwargs: Any) - "linkId": _SERIALIZER.url("link_id", link_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -119,7 +119,7 @@ def build_resource_links_get_request(link_id: str, **kwargs: Any) -> HttpRequest "linkId": _SERIALIZER.url("link_id", link_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,7 +145,7 @@ def build_resource_links_list_at_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -173,7 +173,7 @@ def build_resource_links_list_at_source_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -204,6 +204,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -217,7 +218,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -303,6 +304,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -330,7 +332,7 @@ def delete(self, link_id: str, **kwargs: Any) -> None: # pylint: disable=incons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_links_delete_request( @@ -439,7 +441,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceLink] = kwargs.pop("cls", None) @@ -512,7 +514,7 @@ def get(self, link_id: str, **kwargs: Any) -> _models.ResourceLink: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLink] = kwargs.pop("cls", None) request = build_resource_links_get_request( @@ -562,7 +564,7 @@ def list_at_subscription(self, filter: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None) error_map = { @@ -654,7 +656,7 @@ def list_at_source_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceLinkResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_management_lock_client.py index d396bdd76d7cd..265b9e35548d8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_management_lock_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ManagementLockClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ManagementLockClient, self).__init__( @@ -108,7 +110,7 @@ def authorization_operations(self): else: raise ValueError("API version {} does not have operation group 'authorization_operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def management_locks(self): @@ -125,7 +127,7 @@ def management_locks(self): else: raise ValueError("API version {} does not have operation group 'management_locks'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/aio/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/aio/_management_lock_client.py index 97cc79ec0c194..b37b58400b120 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/aio/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/aio/_management_lock_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ManagementLockClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ManagementLockClient, self).__init__( @@ -108,7 +110,7 @@ def authorization_operations(self): else: raise ValueError("API version {} does not have operation group 'authorization_operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def management_locks(self): @@ -125,7 +127,7 @@ def management_locks(self): else: raise ValueError("API version {} does not have operation group 'management_locks'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py index 42216b03715a0..81f85a20a203a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_management_lock_client.py @@ -56,7 +56,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.management_locks = ManagementLocksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py index 04ae9ffc6eb64..add3bf175eb91 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/_management_lock_client.py @@ -56,7 +56,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.management_locks = ManagementLocksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py index 84ae7f38d965a..ee7dfc709d535 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/aio/operations/_operations.py @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update_at_resource_group_level( @@ -156,7 +157,7 @@ async def create_or_update_at_resource_group_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -235,7 +236,7 @@ async def delete_at_resource_group_level( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_group_level_request( @@ -294,7 +295,7 @@ async def get_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_group_level_request( @@ -457,7 +458,7 @@ async def create_or_update_at_resource_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -555,7 +556,7 @@ async def delete_at_resource_level( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_level_request( @@ -665,7 +666,7 @@ async def create_or_update_at_subscription_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -741,7 +742,7 @@ async def delete_at_subscription_level( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_subscription_level_request( @@ -795,7 +796,7 @@ async def get(self, lock_name: str, **kwargs: Any) -> _models.ManagementLockObje _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_request( @@ -849,7 +850,7 @@ def list_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -957,7 +958,7 @@ def list_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1051,7 +1052,7 @@ def list_at_subscription_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py index ad05a50032c8d..82268c0126608 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -60,7 +60,7 @@ def build_management_locks_create_or_update_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +92,7 @@ def build_management_locks_delete_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,7 +122,7 @@ def build_management_locks_get_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,7 +167,7 @@ def build_management_locks_create_or_update_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -210,7 +210,7 @@ def build_management_locks_delete_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -237,7 +237,7 @@ def build_management_locks_create_or_update_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,7 +265,7 @@ def build_management_locks_delete_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -289,7 +289,7 @@ def build_management_locks_get_request(lock_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -321,7 +321,7 @@ def build_management_locks_list_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -367,7 +367,7 @@ def build_management_locks_list_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -395,7 +395,7 @@ def build_management_locks_list_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -426,6 +426,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update_at_resource_group_level( @@ -517,7 +518,7 @@ def create_or_update_at_resource_group_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -596,7 +597,7 @@ def delete_at_resource_group_level( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_group_level_request( @@ -655,7 +656,7 @@ def get_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_group_level_request( @@ -818,7 +819,7 @@ def create_or_update_at_resource_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -916,7 +917,7 @@ def delete_at_resource_level( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_level_request( @@ -1026,7 +1027,7 @@ def create_or_update_at_subscription_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -1102,7 +1103,7 @@ def delete_at_subscription_level( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_subscription_level_request( @@ -1156,7 +1157,7 @@ def get(self, lock_name: str, **kwargs: Any) -> _models.ManagementLockObject: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_request( @@ -1210,7 +1211,7 @@ def list_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1318,7 +1319,7 @@ def list_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1412,7 +1413,7 @@ def list_at_subscription_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2015-01-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py index 2490a8f247c7f..23feb200125de 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_management_lock_client.py @@ -60,10 +60,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.authorization_operations = AuthorizationOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) self.management_locks = ManagementLocksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py index f968ad082615f..0d9488b3d2997 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/_management_lock_client.py @@ -60,10 +60,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.authorization_operations = AuthorizationOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) self.management_locks = ManagementLocksOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py index ca42bd021338c..e920198cf599e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_operations.py @@ -71,6 +71,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -85,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -171,6 +172,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update_at_resource_group_level( @@ -280,7 +282,7 @@ async def create_or_update_at_resource_group_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -363,7 +365,7 @@ async def delete_at_resource_group_level( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_group_level_request( @@ -422,7 +424,7 @@ async def get_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_group_level_request( @@ -551,7 +553,7 @@ async def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -627,7 +629,7 @@ async def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_by_scope_request( @@ -681,7 +683,7 @@ async def get_by_scope(self, scope: str, lock_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_by_scope_request( @@ -865,7 +867,7 @@ async def create_or_update_at_resource_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -969,7 +971,7 @@ async def delete_at_resource_level( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_level_request( @@ -1048,7 +1050,7 @@ async def get_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_level_request( @@ -1180,7 +1182,7 @@ async def create_or_update_at_subscription_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -1260,7 +1262,7 @@ async def delete_at_subscription_level( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_subscription_level_request( @@ -1314,7 +1316,7 @@ async def get_at_subscription_level(self, lock_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_subscription_level_request( @@ -1371,7 +1373,7 @@ def list_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1479,7 +1481,7 @@ def list_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1573,7 +1575,7 @@ def list_at_subscription_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1668,7 +1670,7 @@ def list_by_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py index 74cccaf83ddd1..6a1a54196713a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +79,7 @@ def build_management_locks_create_or_update_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,7 +111,7 @@ def build_management_locks_delete_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -141,7 +141,7 @@ def build_management_locks_get_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,7 +167,7 @@ def build_management_locks_create_or_update_by_scope_request(scope: str, lock_na "lockName": _SERIALIZER.url("lock_name", lock_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_management_locks_delete_by_scope_request(scope: str, lock_name: str, * "lockName": _SERIALIZER.url("lock_name", lock_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,7 +213,7 @@ def build_management_locks_get_by_scope_request(scope: str, lock_name: str, **kw "lockName": _SERIALIZER.url("lock_name", lock_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -258,7 +258,7 @@ def build_management_locks_create_or_update_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -301,7 +301,7 @@ def build_management_locks_delete_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -342,7 +342,7 @@ def build_management_locks_get_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -372,7 +372,7 @@ def build_management_locks_create_or_update_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -400,7 +400,7 @@ def build_management_locks_delete_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -426,7 +426,7 @@ def build_management_locks_get_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +458,7 @@ def build_management_locks_list_at_resource_group_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -504,7 +504,7 @@ def build_management_locks_list_at_resource_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -532,7 +532,7 @@ def build_management_locks_list_at_subscription_level_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -560,7 +560,7 @@ def build_management_locks_list_by_scope_request( "scope": _SERIALIZER.url("scope", scope, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -591,6 +591,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -604,7 +605,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -690,6 +691,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update_at_resource_group_level( @@ -799,7 +801,7 @@ def create_or_update_at_resource_group_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -882,7 +884,7 @@ def delete_at_resource_group_level( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_group_level_request( @@ -941,7 +943,7 @@ def get_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_group_level_request( @@ -1070,7 +1072,7 @@ def create_or_update_by_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -1146,7 +1148,7 @@ def delete_by_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_by_scope_request( @@ -1200,7 +1202,7 @@ def get_by_scope(self, scope: str, lock_name: str, **kwargs: Any) -> _models.Man _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_by_scope_request( @@ -1384,7 +1386,7 @@ def create_or_update_at_resource_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -1488,7 +1490,7 @@ def delete_at_resource_level( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_resource_level_request( @@ -1567,7 +1569,7 @@ def get_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_resource_level_request( @@ -1699,7 +1701,7 @@ def create_or_update_at_subscription_level( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) @@ -1779,7 +1781,7 @@ def delete_at_subscription_level( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_management_locks_delete_at_subscription_level_request( @@ -1833,7 +1835,7 @@ def get_at_subscription_level(self, lock_name: str, **kwargs: Any) -> _models.Ma _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockObject] = kwargs.pop("cls", None) request = build_management_locks_get_at_subscription_level_request( @@ -1890,7 +1892,7 @@ def list_at_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -1998,7 +2000,7 @@ def list_at_resource_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -2092,7 +2094,7 @@ def list_at_subscription_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { @@ -2187,7 +2189,7 @@ def list_by_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ManagementLockListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_application_client.py index 62b7dfb2cc01a..5f43cbf250512 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_application_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_application_client.py @@ -72,6 +72,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ApplicationClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ApplicationClient, self).__init__( @@ -106,7 +108,7 @@ def application_definitions(self): else: raise ValueError("API version {} does not have operation group 'application_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def applications(self): @@ -120,7 +122,7 @@ def applications(self): else: raise ValueError("API version {} does not have operation group 'applications'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def jit_requests(self): @@ -134,7 +136,7 @@ def jit_requests(self): else: raise ValueError("API version {} does not have operation group 'jit_requests'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/aio/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/aio/_application_client.py index f678f4c1e128e..226acf542a5d6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/aio/_application_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/aio/_application_client.py @@ -72,6 +72,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ApplicationClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ApplicationClient, self).__init__( @@ -106,7 +108,7 @@ def application_definitions(self): else: raise ValueError("API version {} does not have operation group 'application_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def applications(self): @@ -120,7 +122,7 @@ def applications(self): else: raise ValueError("API version {} does not have operation group 'applications'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def jit_requests(self): @@ -134,7 +136,7 @@ def jit_requests(self): else: raise ValueError("API version {} does not have operation group 'jit_requests'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py index 1588ebf62a8f6..06724beaaa6be 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_application_client.py @@ -66,11 +66,15 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.applications = ApplicationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.applications = ApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) self.application_definitions = ApplicationDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.jit_requests = JitRequestsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" ) - self.jit_requests = JitRequestsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py index 06217a584f638..40ef928ee287b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class ApplicationClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py index 274f188a18212..d9941ce6264d2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/_application_client.py @@ -66,11 +66,15 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.applications = ApplicationsOperations(self._client, self._config, self._serialize, self._deserialize) + self.applications = ApplicationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) self.application_definitions = ApplicationDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.jit_requests = JitRequestsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" ) - self.jit_requests = JitRequestsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py index 432c18ee06ee9..c83e9da95606b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/aio/operations/_operations.py @@ -65,6 +65,12 @@ class ApplicationClientOperationsMixin(ApplicationClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """Lists all of the available Microsoft.Solutions REST API operations. @@ -78,7 +84,9 @@ def list_operations(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2019-07-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -164,6 +172,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get(self, resource_group_name: str, application_name: str, **kwargs: Any) -> _models.Application: @@ -190,7 +199,7 @@ async def get(self, resource_group_name: str, application_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_applications_get_request( @@ -242,7 +251,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_delete_request( @@ -302,7 +311,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -356,7 +365,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -518,7 +527,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -663,7 +672,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Application]] = kwargs.pop("cls", None) @@ -734,7 +743,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None) error_map = { @@ -819,7 +828,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Applicat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None) error_map = { @@ -915,7 +924,7 @@ async def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Applica _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_applications_get_by_id_request( @@ -963,7 +972,7 @@ async def _delete_by_id_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_delete_by_id_request( @@ -1017,7 +1026,7 @@ async def begin_delete_by_id(self, application_id: str, **kwargs: Any) -> AsyncL _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1068,7 +1077,7 @@ async def _create_or_update_by_id_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -1219,7 +1228,7 @@ async def begin_create_or_update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1353,7 +1362,7 @@ async def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -1416,7 +1425,7 @@ async def _refresh_permissions_initial( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_refresh_permissions_request( @@ -1476,7 +1485,7 @@ async def begin_refresh_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1535,6 +1544,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -1563,7 +1573,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) request = build_application_definitions_get_request( @@ -1615,7 +1625,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_application_definitions_delete_request( @@ -1676,7 +1686,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1734,7 +1744,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) @@ -1904,7 +1914,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1968,7 +1978,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2067,7 +2077,7 @@ async def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) request = build_application_definitions_get_by_id_request( @@ -2119,7 +2129,7 @@ async def _delete_by_id_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_application_definitions_delete_by_id_request( @@ -2179,7 +2189,7 @@ async def begin_delete_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2237,7 +2247,7 @@ async def _create_or_update_by_id_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) @@ -2407,7 +2417,7 @@ async def begin_create_or_update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2471,6 +2481,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get(self, resource_group_name: str, jit_request_name: str, **kwargs: Any) -> _models.JitRequestDefinition: @@ -2497,7 +2508,7 @@ async def get(self, resource_group_name: str, jit_request_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) request = build_jit_requests_get_request( @@ -2553,7 +2564,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) @@ -2721,7 +2732,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2861,7 +2872,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) @@ -2938,7 +2949,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_jit_requests_delete_request( @@ -2993,7 +3004,7 @@ async def list_by_subscription(self, **kwargs: Any) -> _models.JitRequestDefinit _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinitionListResult] = kwargs.pop("cls", None) request = build_jit_requests_list_by_subscription_request( @@ -3053,7 +3064,7 @@ async def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinitionListResult] = kwargs.pop("cls", None) request = build_jit_requests_list_by_resource_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py index f068ba65ee61f..a5b165d04c25c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/managedapplications/v2019_07_01/operations/_operations.py @@ -30,7 +30,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import ApplicationClientMixinABC, _convert_request, _format_url_section +from .._vendor import ApplicationClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +80,7 @@ def build_applications_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,7 +113,7 @@ def build_applications_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,7 +147,7 @@ def build_applications_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,7 +183,7 @@ def build_applications_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -217,7 +217,7 @@ def build_applications_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -241,7 +241,7 @@ def build_applications_list_by_subscription_request(subscription_id: str, **kwar "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,7 +265,7 @@ def build_applications_get_by_id_request(application_id: str, **kwargs: Any) -> "applicationId": _SERIALIZER.url("application_id", application_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -289,7 +289,7 @@ def build_applications_delete_by_id_request(application_id: str, **kwargs: Any) "applicationId": _SERIALIZER.url("application_id", application_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,7 +314,7 @@ def build_applications_create_or_update_by_id_request(application_id: str, **kwa "applicationId": _SERIALIZER.url("application_id", application_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -341,7 +341,7 @@ def build_applications_update_by_id_request(application_id: str, **kwargs: Any) "applicationId": _SERIALIZER.url("application_id", application_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -376,7 +376,7 @@ def build_applications_refresh_permissions_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -411,7 +411,7 @@ def build_application_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -446,7 +446,7 @@ def build_application_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -482,7 +482,7 @@ def build_application_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -516,7 +516,7 @@ def build_application_definitions_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -551,7 +551,7 @@ def build_application_definitions_get_by_id_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -586,7 +586,7 @@ def build_application_definitions_delete_by_id_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -622,7 +622,7 @@ def build_application_definitions_create_or_update_by_id_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -657,7 +657,7 @@ def build_jit_requests_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -691,7 +691,7 @@ def build_jit_requests_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -727,7 +727,7 @@ def build_jit_requests_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -762,7 +762,7 @@ def build_jit_requests_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -786,7 +786,7 @@ def build_jit_requests_list_by_subscription_request(subscription_id: str, **kwar "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -818,7 +818,7 @@ def build_jit_requests_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -830,6 +830,12 @@ def build_jit_requests_list_by_resource_group_request( class ApplicationClientOperationsMixin(ApplicationClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @distributed_trace def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: """Lists all of the available Microsoft.Solutions REST API operations. @@ -843,7 +849,9 @@ def list_operations(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("list_operations") or "2019-07-01") + ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -929,6 +937,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get(self, resource_group_name: str, application_name: str, **kwargs: Any) -> _models.Application: @@ -955,7 +964,7 @@ def get(self, resource_group_name: str, application_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_applications_get_request( @@ -1007,7 +1016,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_delete_request( @@ -1065,7 +1074,7 @@ def begin_delete(self, resource_group_name: str, application_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1119,7 +1128,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -1281,7 +1290,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1426,7 +1435,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Application]] = kwargs.pop("cls", None) @@ -1497,7 +1506,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None) error_map = { @@ -1582,7 +1591,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Application"] _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationListResult] = kwargs.pop("cls", None) error_map = { @@ -1678,7 +1687,7 @@ def get_by_id(self, application_id: str, **kwargs: Any) -> _models.Application: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_applications_get_by_id_request( @@ -1726,7 +1735,7 @@ def _delete_by_id_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_delete_by_id_request( @@ -1780,7 +1789,7 @@ def begin_delete_by_id(self, application_id: str, **kwargs: Any) -> LROPoller[No _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1831,7 +1840,7 @@ def _create_or_update_by_id_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -1982,7 +1991,7 @@ def begin_create_or_update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2116,7 +2125,7 @@ def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Application] = kwargs.pop("cls", None) @@ -2179,7 +2188,7 @@ def _refresh_permissions_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_applications_refresh_permissions_request( @@ -2239,7 +2248,7 @@ def begin_refresh_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2298,6 +2307,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -2326,7 +2336,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) request = build_application_definitions_get_request( @@ -2378,7 +2388,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_application_definitions_delete_request( @@ -2439,7 +2449,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2497,7 +2507,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) @@ -2667,7 +2677,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2731,7 +2741,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2830,7 +2840,7 @@ def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) request = build_application_definitions_get_by_id_request( @@ -2882,7 +2892,7 @@ def _delete_by_id_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_application_definitions_delete_by_id_request( @@ -2942,7 +2952,7 @@ def begin_delete_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3000,7 +3010,7 @@ def _create_or_update_by_id_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) @@ -3170,7 +3180,7 @@ def begin_create_or_update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ApplicationDefinition] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3234,6 +3244,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get(self, resource_group_name: str, jit_request_name: str, **kwargs: Any) -> _models.JitRequestDefinition: @@ -3260,7 +3271,7 @@ def get(self, resource_group_name: str, jit_request_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) request = build_jit_requests_get_request( @@ -3316,7 +3327,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) @@ -3484,7 +3495,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3624,7 +3635,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JitRequestDefinition] = kwargs.pop("cls", None) @@ -3701,7 +3712,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_jit_requests_delete_request( @@ -3756,7 +3767,7 @@ def list_by_subscription(self, **kwargs: Any) -> _models.JitRequestDefinitionLis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinitionListResult] = kwargs.pop("cls", None) request = build_jit_requests_list_by_subscription_request( @@ -3814,7 +3825,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.JitRequestDefinitionListResult] = kwargs.pop("cls", None) request = build_jit_requests_list_by_resource_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py index bb1e1f9f777d6..2be67acd28c80 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py @@ -73,6 +73,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = PolicyClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(PolicyClient, self).__init__( @@ -163,7 +165,7 @@ def data_policy_manifests(self): else: raise ValueError("API version {} does not have operation group 'data_policy_manifests'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_assignments(self): @@ -210,7 +212,7 @@ def policy_assignments(self): else: raise ValueError("API version {} does not have operation group 'policy_assignments'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_definitions(self): @@ -251,7 +253,7 @@ def policy_definitions(self): else: raise ValueError("API version {} does not have operation group 'policy_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_exemptions(self): @@ -268,7 +270,7 @@ def policy_exemptions(self): else: raise ValueError("API version {} does not have operation group 'policy_exemptions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_set_definitions(self): @@ -303,7 +305,7 @@ def policy_set_definitions(self): else: raise ValueError("API version {} does not have operation group 'policy_set_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def variable_values(self): @@ -317,7 +319,7 @@ def variable_values(self): else: raise ValueError("API version {} does not have operation group 'variable_values'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def variables(self): @@ -331,7 +333,7 @@ def variables(self): else: raise ValueError("API version {} does not have operation group 'variables'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/aio/_policy_client.py index 399c2f6871687..2cc546cee67c7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/aio/_policy_client.py @@ -73,6 +73,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = PolicyClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(PolicyClient, self).__init__( @@ -163,7 +165,7 @@ def data_policy_manifests(self): else: raise ValueError("API version {} does not have operation group 'data_policy_manifests'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_assignments(self): @@ -210,7 +212,7 @@ def policy_assignments(self): else: raise ValueError("API version {} does not have operation group 'policy_assignments'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_definitions(self): @@ -251,7 +253,7 @@ def policy_definitions(self): else: raise ValueError("API version {} does not have operation group 'policy_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_exemptions(self): @@ -268,7 +270,7 @@ def policy_exemptions(self): else: raise ValueError("API version {} does not have operation group 'policy_exemptions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def policy_set_definitions(self): @@ -303,7 +305,7 @@ def policy_set_definitions(self): else: raise ValueError("API version {} does not have operation group 'policy_set_definitions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def variable_values(self): @@ -317,7 +319,7 @@ def variable_values(self): else: raise ValueError("API version {} does not have operation group 'variable_values'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def variables(self): @@ -331,7 +333,7 @@ def variables(self): else: raise ValueError("API version {} does not have operation group 'variables'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py index 153eb4f475555..3cfc60373c793 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-10-01-preview" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-10-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py index da9a098450993..b800b4ba934bc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-10-01-preview" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2015-10-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py index 7cfe99800bc7d..7ea0c11f903ad 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/aio/operations/_operations.py @@ -67,6 +67,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment: @@ -92,7 +93,9 @@ async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -221,7 +224,9 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -291,7 +296,9 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -345,7 +352,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -452,7 +461,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -543,7 +554,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -642,7 +655,9 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -778,7 +793,9 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -853,7 +870,9 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -905,6 +924,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -979,7 +999,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1051,7 +1073,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1105,7 +1129,9 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1156,7 +1182,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py index 5215b76ec042f..859d7d151ea71 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -410,7 +410,7 @@ def build_policy_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -441,6 +441,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment: @@ -466,7 +467,9 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -595,7 +598,9 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -665,7 +670,9 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -719,7 +726,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -826,7 +835,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -917,7 +928,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1016,7 +1029,9 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1152,7 +1167,9 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1227,7 +1244,9 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1279,6 +1298,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1353,7 +1373,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1425,7 +1447,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1479,7 +1503,9 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1530,7 +1556,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2015-10-01-preview") + ) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py index 620e13f9f8da2..7b457b0637bbd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-04-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-04-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py index 57858ac5062a1..ea63582446759 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-04-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-04-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py index dad64619028eb..a5543a14d5b48 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/aio/operations/_operations.py @@ -67,6 +67,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment: @@ -92,7 +93,7 @@ async def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -221,7 +222,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -291,7 +292,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -345,7 +346,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -452,7 +453,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -543,7 +544,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -642,7 +643,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -778,7 +779,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -853,7 +854,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -905,6 +906,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -979,7 +981,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1051,7 +1053,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1105,7 +1107,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1156,7 +1158,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py index cc0e96a01d465..340ca1d57fa43 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -410,7 +410,7 @@ def build_policy_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -441,6 +441,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models.PolicyAssignment: @@ -466,7 +467,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -595,7 +596,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -665,7 +666,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -719,7 +720,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -826,7 +827,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -917,7 +918,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1016,7 +1017,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1152,7 +1153,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1227,7 +1228,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1279,6 +1280,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1353,7 +1355,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1425,7 +1427,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1479,7 +1481,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1530,7 +1532,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-04-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py index f87bc467847c7..68ac5bcd8af05 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-12-01" ) self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-12-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py index 5a292f9002480..74a934f4cf015 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-12-01" ) self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-12-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py index 1f8355fb1649f..03a78c23524e3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/aio/operations/_operations.py @@ -73,6 +73,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -147,7 +148,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -219,7 +220,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -273,7 +274,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -331,7 +332,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -454,7 +455,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -528,7 +529,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -586,7 +587,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -635,7 +636,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -716,7 +717,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -800,7 +801,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -889,6 +890,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -916,7 +918,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1047,7 +1049,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1117,7 +1119,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1171,7 +1173,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1278,7 +1280,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1369,7 +1371,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1468,7 +1470,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1604,7 +1606,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1679,7 +1681,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py index 9059f3b6d8f2b..b8f8ddac5eb0e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2016_12_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,7 +57,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +86,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,7 +113,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,7 +168,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,7 +224,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -296,7 +296,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -323,7 +323,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -351,7 +351,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -412,7 +412,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -458,7 +458,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -488,7 +488,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -514,7 +514,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -539,7 +539,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -594,6 +594,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -668,7 +669,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -740,7 +741,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -794,7 +795,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -852,7 +853,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -975,7 +976,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1049,7 +1050,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1107,7 +1108,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1156,7 +1157,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1237,7 +1238,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1319,7 +1320,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1408,6 +1409,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -1433,7 +1435,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1564,7 +1566,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1634,7 +1636,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1688,7 +1690,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1795,7 +1797,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1886,7 +1888,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1985,7 +1987,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -2121,7 +2123,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -2196,7 +2198,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-12-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py index f06206934eb35..4054531df292d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-06-01-preview" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-06-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py index a71387e3c519a..c179f1a860c7d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/_policy_client.py @@ -58,10 +58,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-06-01-preview" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-06-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py index d629a40e020b0..4916bf68592d2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/aio/operations/_operations.py @@ -73,6 +73,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -100,7 +101,9 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -232,7 +235,9 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -303,7 +308,9 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -358,7 +365,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -466,7 +475,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -558,7 +569,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -658,7 +671,9 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -795,7 +810,9 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -871,7 +888,9 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -924,6 +943,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -999,7 +1019,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -1076,7 +1098,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -1131,7 +1155,9 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -1190,7 +1216,9 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -1237,7 +1265,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1319,7 +1349,9 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1478,7 +1510,9 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -1557,7 +1591,9 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -1616,7 +1652,9 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -1670,7 +1708,9 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py index ad8c693245fe8..02bd722c2a0e1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -358,7 +358,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -388,7 +388,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -414,7 +414,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -490,7 +490,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -522,7 +522,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -552,7 +552,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -581,7 +581,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -610,6 +610,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -635,7 +636,9 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -767,7 +770,9 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -838,7 +843,9 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -893,7 +900,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1001,7 +1010,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1093,7 +1104,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1193,7 +1206,9 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.Poli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1330,7 +1345,9 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1406,7 +1423,9 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1459,6 +1478,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1534,7 +1554,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -1611,7 +1633,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -1666,7 +1690,9 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -1725,7 +1751,9 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -1772,7 +1800,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1854,7 +1884,9 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2013,7 +2045,9 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2092,7 +2126,9 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2151,7 +2187,9 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2205,7 +2243,9 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2017-06-01-preview") + ) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py index 9f6384bd2693c..19cc79c1cba4f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py index 2c32c96ad822d..52538edac014f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-03-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py index ee17c7efd85c0..5ac1c88739508 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/aio/operations/_operations.py @@ -83,6 +83,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -119,7 +120,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -269,7 +270,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -348,7 +349,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -416,7 +417,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -552,7 +553,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -657,7 +658,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: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -758,7 +759,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -903,7 +904,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -981,7 +982,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1034,6 +1035,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1117,7 +1119,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1191,7 +1193,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1247,7 +1249,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1307,7 +1309,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1439,7 +1441,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1515,7 +1517,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1576,7 +1578,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1627,7 +1629,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1710,7 +1712,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1796,7 +1798,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1885,6 +1887,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1968,7 +1971,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2047,7 +2050,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2105,7 +2108,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2166,7 +2169,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2215,7 +2218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2299,7 +2302,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2466,7 +2469,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2548,7 +2551,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2610,7 +2613,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2667,7 +2670,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py index 46573cecb0b04..dcaa3cce42b63 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_03_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -406,7 +406,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -437,7 +437,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -466,7 +466,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -493,7 +493,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -519,7 +519,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -596,7 +596,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -628,7 +628,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -658,7 +658,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -684,7 +684,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -710,7 +710,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -760,7 +760,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -792,7 +792,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -822,7 +822,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -851,7 +851,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -880,6 +880,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -914,7 +915,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1064,7 +1065,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1143,7 +1144,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1211,7 +1212,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1347,7 +1348,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1452,7 +1453,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: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1553,7 +1554,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1698,7 +1699,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1776,7 +1777,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1829,6 +1830,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1912,7 +1914,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1986,7 +1988,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2042,7 +2044,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2102,7 +2104,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2234,7 +2236,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2310,7 +2312,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2371,7 +2373,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2422,7 +2424,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2505,7 +2507,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2589,7 +2591,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2678,6 +2680,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2761,7 +2764,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2840,7 +2843,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2898,7 +2901,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2959,7 +2962,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3008,7 +3011,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3092,7 +3095,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3259,7 +3262,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3341,7 +3344,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3403,7 +3406,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3460,7 +3463,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py index 05bb675f0ef46..62edbe778f7aa 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py index 2c0cf90621aa5..df30bbbdace5c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py index afb50248d2d31..113bfa1e8d38f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/aio/operations/_operations.py @@ -83,6 +83,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -119,7 +120,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -269,7 +270,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -348,7 +349,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -416,7 +417,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -552,7 +553,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -657,7 +658,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: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -758,7 +759,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -903,7 +904,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -981,7 +982,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1034,6 +1035,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1117,7 +1119,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1191,7 +1193,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1247,7 +1249,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1307,7 +1309,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1439,7 +1441,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1515,7 +1517,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1576,7 +1578,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1627,7 +1629,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1710,7 +1712,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1796,7 +1798,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1885,6 +1887,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1968,7 +1971,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2047,7 +2050,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2105,7 +2108,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2166,7 +2169,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2215,7 +2218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2299,7 +2302,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2466,7 +2469,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2548,7 +2551,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2610,7 +2613,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2667,7 +2670,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py index b8c420ce47976..b6a4438e09f5a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2018_05_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -406,7 +406,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -437,7 +437,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -466,7 +466,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -493,7 +493,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -519,7 +519,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -596,7 +596,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -628,7 +628,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -658,7 +658,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -684,7 +684,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -710,7 +710,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -760,7 +760,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -792,7 +792,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -822,7 +822,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -851,7 +851,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -880,6 +880,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -914,7 +915,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1064,7 +1065,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1143,7 +1144,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1211,7 +1212,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1347,7 +1348,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1452,7 +1453,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: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1553,7 +1554,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1698,7 +1699,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1776,7 +1777,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1829,6 +1830,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1912,7 +1914,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1986,7 +1988,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2042,7 +2044,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2102,7 +2104,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2234,7 +2236,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2310,7 +2312,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2371,7 +2373,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2422,7 +2424,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2505,7 +2507,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2589,7 +2591,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2678,6 +2680,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2761,7 +2764,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2840,7 +2843,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2898,7 +2901,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2959,7 +2962,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3008,7 +3011,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3092,7 +3095,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3259,7 +3262,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3341,7 +3344,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3403,7 +3406,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3460,7 +3463,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py index b03f4817b13fc..c3959a3031516 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py index 0635f41d3f2b1..54f2da18b301d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py index 79c289405124c..c794926e52ceb 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/aio/operations/_operations.py @@ -83,6 +83,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -119,7 +120,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -269,7 +270,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -348,7 +349,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -416,7 +417,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -552,7 +553,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -657,7 +658,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -758,7 +759,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -903,7 +904,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -981,7 +982,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1034,6 +1035,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1117,7 +1119,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1191,7 +1193,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1247,7 +1249,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1307,7 +1309,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1439,7 +1441,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1515,7 +1517,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1576,7 +1578,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1627,7 +1629,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1710,7 +1712,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1796,7 +1798,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1885,6 +1887,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1968,7 +1971,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2047,7 +2050,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2105,7 +2108,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2166,7 +2169,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2215,7 +2218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2299,7 +2302,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2466,7 +2469,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2548,7 +2551,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2610,7 +2613,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2667,7 +2670,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py index c3ed2a8fdee20..19ca284aca5ff 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_01_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -406,7 +406,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -437,7 +437,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -466,7 +466,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -493,7 +493,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -519,7 +519,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -596,7 +596,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -628,7 +628,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -658,7 +658,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -684,7 +684,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -710,7 +710,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -760,7 +760,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -792,7 +792,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -822,7 +822,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -851,7 +851,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -880,6 +880,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -914,7 +915,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1064,7 +1065,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1143,7 +1144,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1211,7 +1212,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1347,7 +1348,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1452,7 +1453,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1553,7 +1554,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1698,7 +1699,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1776,7 +1777,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1829,6 +1830,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1912,7 +1914,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1986,7 +1988,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2042,7 +2044,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2102,7 +2104,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2234,7 +2236,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2310,7 +2312,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2371,7 +2373,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2422,7 +2424,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2505,7 +2507,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2589,7 +2591,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2678,6 +2680,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2761,7 +2764,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2840,7 +2843,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2898,7 +2901,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2959,7 +2962,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3008,7 +3011,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3092,7 +3095,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3259,7 +3262,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3341,7 +3344,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3403,7 +3406,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3460,7 +3463,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-01-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py index df03e89d2853b..47a1cda5eb4e0 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py index 79ed2639909b3..fe02ef877ba9a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py index be1e8105e8d60..7115c7a2e92ad 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/aio/operations/_operations.py @@ -83,6 +83,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -119,7 +120,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -269,7 +270,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -348,7 +349,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -416,7 +417,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -552,7 +553,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -657,7 +658,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -758,7 +759,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -903,7 +904,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -981,7 +982,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1034,6 +1035,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1117,7 +1119,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1191,7 +1193,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1247,7 +1249,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1307,7 +1309,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1439,7 +1441,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1515,7 +1517,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1576,7 +1578,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1627,7 +1629,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1710,7 +1712,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1796,7 +1798,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1885,6 +1887,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1968,7 +1971,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2047,7 +2050,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2105,7 +2108,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2166,7 +2169,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2215,7 +2218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2299,7 +2302,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2466,7 +2469,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2548,7 +2551,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2610,7 +2613,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2667,7 +2670,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py index 5be2dbf3c9eb8..3df4f5a48caf1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -218,7 +218,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -244,7 +244,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,7 +269,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -295,7 +295,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,7 +326,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,7 +355,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -382,7 +382,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -406,7 +406,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -437,7 +437,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -466,7 +466,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -493,7 +493,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -519,7 +519,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -596,7 +596,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -628,7 +628,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -658,7 +658,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -684,7 +684,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -710,7 +710,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -760,7 +760,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -792,7 +792,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -822,7 +822,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -851,7 +851,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -880,6 +880,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -914,7 +915,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1064,7 +1065,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1143,7 +1144,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1211,7 +1212,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1347,7 +1348,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1452,7 +1453,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1553,7 +1554,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1698,7 +1699,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1776,7 +1777,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1829,6 +1830,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1912,7 +1914,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1986,7 +1988,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2042,7 +2044,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2102,7 +2104,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2234,7 +2236,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2310,7 +2312,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2371,7 +2373,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2422,7 +2424,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2505,7 +2507,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2589,7 +2591,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2678,6 +2680,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2761,7 +2764,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2840,7 +2843,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2898,7 +2901,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2959,7 +2962,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3008,7 +3011,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3092,7 +3095,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3259,7 +3262,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3341,7 +3344,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3403,7 +3406,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3460,7 +3463,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py index eb539b7a51965..2907e9d240e88 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py index 1eb736f4aaf72..44f92fea36eef 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py index 6d128e87099d8..74321fb12a403 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/aio/operations/_operations.py @@ -84,6 +84,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -120,7 +121,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -269,7 +270,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -347,7 +348,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -414,7 +415,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -549,7 +550,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -653,7 +654,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -752,7 +753,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -852,7 +853,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -996,7 +997,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1073,7 +1074,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1125,6 +1126,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1208,7 +1210,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1282,7 +1284,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1338,7 +1340,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1398,7 +1400,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1530,7 +1532,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1606,7 +1608,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1667,7 +1669,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1718,7 +1720,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1801,7 +1803,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicyDefinitio _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1887,7 +1889,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -1976,6 +1978,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -2059,7 +2062,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2137,7 +2140,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2194,7 +2197,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2254,7 +2257,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2302,7 +2305,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2385,7 +2388,7 @@ def list_built_in(self, **kwargs: Any) -> AsyncIterable["_models.PolicySetDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2551,7 +2554,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2632,7 +2635,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -2693,7 +2696,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -2749,7 +2752,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py index 7c8afc739b529..e6d32b79f448f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -188,7 +188,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -219,7 +219,7 @@ def build_policy_assignments_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["$filter"] = _SERIALIZER.query("filter", filter, "str", skip_quote=True) @@ -248,7 +248,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -274,7 +274,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -299,7 +299,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -325,7 +325,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -356,7 +356,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -388,7 +388,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -418,7 +418,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -442,7 +442,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -473,7 +473,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -505,7 +505,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -535,7 +535,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -561,7 +561,7 @@ def build_policy_definitions_list_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -607,7 +607,7 @@ def build_policy_definitions_list_by_management_group_request(management_group_i "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -638,7 +638,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -670,7 +670,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -700,7 +700,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -726,7 +726,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -752,7 +752,7 @@ def build_policy_set_definitions_list_request(subscription_id: str, **kwargs: An "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -802,7 +802,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -834,7 +834,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -864,7 +864,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -893,7 +893,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -922,6 +922,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -956,7 +957,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1105,7 +1106,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1183,7 +1184,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1250,7 +1251,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1385,7 +1386,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1489,7 +1490,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1588,7 +1589,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: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1688,7 +1689,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1832,7 +1833,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1909,7 +1910,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1961,6 +1962,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2044,7 +2046,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2118,7 +2120,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2174,7 +2176,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2234,7 +2236,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2366,7 +2368,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2442,7 +2444,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2503,7 +2505,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2554,7 +2556,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2637,7 +2639,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicyDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2721,7 +2723,7 @@ def list_by_management_group(self, management_group_id: str, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2810,6 +2812,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2893,7 +2896,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2971,7 +2974,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -3028,7 +3031,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -3088,7 +3091,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3136,7 +3139,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3219,7 +3222,7 @@ def list_built_in(self, **kwargs: Any) -> Iterable["_models.PolicySetDefinition" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3385,7 +3388,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3466,7 +3469,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3527,7 +3530,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3583,7 +3586,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py index 581050251e24a..f65162770e64d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_exemptions = PolicyExemptionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-07-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py index 2bade8a8fb324..b7a0ffc1a39b7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_exemptions = PolicyExemptionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-07-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py index 635a665b5197c..2c49bf009b782 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/aio/operations/_operations.py @@ -61,6 +61,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -97,7 +98,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_exemptions_delete_request( @@ -243,7 +246,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -327,7 +332,9 @@ async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) request = build_policy_exemptions_get_request( @@ -394,7 +401,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -500,7 +509,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -640,7 +651,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -752,7 +765,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py index daf6946a33653..2d7ddfd85fa88 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_07_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_exemptions_delete_request(scope: str, policy_exemption_name: st "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +83,7 @@ def build_policy_exemptions_create_or_update_request( "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,7 +112,7 @@ def build_policy_exemptions_get_request(scope: str, policy_exemption_name: str, "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,7 +140,7 @@ def build_policy_exemptions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -174,7 +174,7 @@ def build_policy_exemptions_list_for_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -220,7 +220,7 @@ def build_policy_exemptions_list_for_resource_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -251,7 +251,7 @@ def build_policy_exemptions_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -282,6 +282,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -318,7 +319,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_exemptions_delete_request( @@ -464,7 +467,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -548,7 +553,9 @@ def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) request = build_policy_exemptions_get_request( @@ -615,7 +622,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -721,7 +730,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -861,7 +872,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -973,7 +986,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2020-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py index e23c826abc402..42ce2b6dce090 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_policy_client.py @@ -69,16 +69,16 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.data_policy_manifests = DataPolicyManifestsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py index f847bf540f12a..32e3825a9ee4a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/_policy_client.py @@ -69,16 +69,16 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.data_policy_manifests = DataPolicyManifestsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py index 54e37d00d4a92..a40f72baa7060 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/aio/operations/_operations.py @@ -86,6 +86,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.DataPolicyManifest: @@ -111,7 +112,7 @@ async def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.D _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.DataPolicyManifest] = kwargs.pop("cls", None) request = build_data_policy_manifests_get_by_policy_mode_request( @@ -168,7 +169,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: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.DataPolicyManifestListResult] = kwargs.pop("cls", None) error_map = { @@ -255,6 +256,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -291,7 +293,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -440,7 +442,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -518,7 +520,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -595,7 +597,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -741,7 +743,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -856,7 +858,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -967,7 +969,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1068,7 +1070,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1212,7 +1214,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1289,7 +1291,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1341,6 +1343,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1424,7 +1427,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1498,7 +1501,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1554,7 +1557,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1614,7 +1617,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1746,7 +1749,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1822,7 +1825,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -1883,7 +1886,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -1957,7 +1960,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2060,7 +2063,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2170,7 +2173,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2261,6 +2264,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -2344,7 +2348,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2422,7 +2426,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2479,7 +2483,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2539,7 +2543,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2610,7 +2614,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2711,7 +2715,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2879,7 +2883,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2960,7 +2964,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3021,7 +3025,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3098,7 +3102,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py index 7138bd7452f3f..4727b85381db4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2020_09_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +50,7 @@ def build_data_policy_manifests_get_by_policy_mode_request(policy_mode: str, **k "policyMode": _SERIALIZER.url("policy_mode", policy_mode, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +98,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +126,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -155,7 +155,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -192,7 +192,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -241,7 +241,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -274,7 +274,7 @@ def build_policy_assignments_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -334,7 +334,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -385,7 +385,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -416,7 +416,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -448,7 +448,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -478,7 +478,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -502,7 +502,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -533,7 +533,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -595,7 +595,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -623,7 +623,7 @@ def build_policy_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -681,7 +681,7 @@ def build_policy_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -716,7 +716,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -748,7 +748,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -778,7 +778,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -804,7 +804,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -832,7 +832,7 @@ def build_policy_set_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -892,7 +892,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -924,7 +924,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -954,7 +954,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -983,7 +983,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1016,6 +1016,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.DataPolicyManifest: @@ -1041,7 +1042,7 @@ def get_by_policy_mode(self, policy_mode: str, **kwargs: Any) -> _models.DataPol _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.DataPolicyManifest] = kwargs.pop("cls", None) request = build_data_policy_manifests_get_by_policy_mode_request( @@ -1098,7 +1099,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: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.DataPolicyManifestListResult] = kwargs.pop("cls", None) error_map = { @@ -1185,6 +1186,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -1219,7 +1221,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1368,7 +1370,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1446,7 +1448,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1523,7 +1525,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1669,7 +1671,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1784,7 +1786,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1895,7 +1897,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1996,7 +1998,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -2140,7 +2142,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -2217,7 +2219,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -2269,6 +2271,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2352,7 +2355,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2426,7 +2429,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2482,7 +2485,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2542,7 +2545,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2674,7 +2677,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2750,7 +2753,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2811,7 +2814,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2885,7 +2888,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2988,7 +2991,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3098,7 +3101,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3189,6 +3192,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -3272,7 +3276,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3350,7 +3354,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -3407,7 +3411,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -3467,7 +3471,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3538,7 +3542,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3639,7 +3643,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3807,7 +3811,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3888,7 +3892,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3949,7 +3953,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -4026,7 +4030,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py index 94ae78229f354..4b4f383061f5e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py index 4350216875868..846e44d7d4ba9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/_policy_client.py @@ -61,13 +61,13 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) self.policy_definitions = PolicyDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) self.policy_set_definitions = PolicySetDefinitionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py index 0c05a431e0974..c833311260858 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/aio/operations/_operations.py @@ -86,6 +86,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -122,7 +123,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -271,7 +272,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -349,7 +350,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -500,7 +501,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -589,7 +590,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -735,7 +736,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -850,7 +851,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -961,7 +962,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1062,7 +1063,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1206,7 +1207,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1283,7 +1284,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1425,7 +1426,7 @@ async def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1489,6 +1490,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -1572,7 +1574,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1646,7 +1648,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -1702,7 +1704,7 @@ async def get(self, policy_definition_name: str, **kwargs: Any) -> _models.Polic _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -1762,7 +1764,7 @@ async def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -1894,7 +1896,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -1970,7 +1972,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2031,7 +2033,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -2105,7 +2107,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2208,7 +2210,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2318,7 +2320,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2409,6 +2411,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -2492,7 +2495,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -2570,7 +2573,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -2627,7 +2630,7 @@ async def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -2687,7 +2690,7 @@ async def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -2758,7 +2761,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -2859,7 +2862,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3027,7 +3030,7 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3108,7 +3111,7 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -3169,7 +3172,7 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -3246,7 +3249,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py index f1db6f0ce1e1e..be10f545713b8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2021_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_policy_assignments_update_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,7 +177,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -226,7 +226,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -259,7 +259,7 @@ def build_policy_assignments_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -291,7 +291,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -319,7 +319,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -344,7 +344,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -370,7 +370,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,7 +395,7 @@ def build_policy_assignments_update_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -428,7 +428,7 @@ def build_policy_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -460,7 +460,7 @@ def build_policy_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -490,7 +490,7 @@ def build_policy_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -514,7 +514,7 @@ def build_policy_definitions_get_built_in_request(policy_definition_name: str, * "policyDefinitionName": _SERIALIZER.url("policy_definition_name", policy_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -545,7 +545,7 @@ def build_policy_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -577,7 +577,7 @@ def build_policy_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -607,7 +607,7 @@ def build_policy_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -635,7 +635,7 @@ def build_policy_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -693,7 +693,7 @@ def build_policy_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -728,7 +728,7 @@ def build_policy_set_definitions_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -760,7 +760,7 @@ def build_policy_set_definitions_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -790,7 +790,7 @@ def build_policy_set_definitions_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +816,7 @@ def build_policy_set_definitions_get_built_in_request(policy_set_definition_name "policySetDefinitionName": _SERIALIZER.url("policy_set_definition_name", policy_set_definition_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -844,7 +844,7 @@ def build_policy_set_definitions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -904,7 +904,7 @@ def build_policy_set_definitions_create_or_update_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -936,7 +936,7 @@ def build_policy_set_definitions_delete_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -966,7 +966,7 @@ def build_policy_set_definitions_get_at_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -995,7 +995,7 @@ def build_policy_set_definitions_list_by_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1028,6 +1028,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -1062,7 +1063,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -1211,7 +1212,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1289,7 +1290,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -1440,7 +1441,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1529,7 +1530,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1675,7 +1676,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1790,7 +1791,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1901,7 +1902,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -2002,7 +2003,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -2146,7 +2147,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -2223,7 +2224,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -2365,7 +2366,7 @@ def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -2429,6 +2430,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -2512,7 +2514,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2586,7 +2588,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_request( @@ -2642,7 +2644,7 @@ def get(self, policy_definition_name: str, **kwargs: Any) -> _models.PolicyDefin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_request( @@ -2702,7 +2704,7 @@ def get_built_in(self, policy_definition_name: str, **kwargs: Any) -> _models.Po _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_built_in_request( @@ -2834,7 +2836,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) @@ -2910,7 +2912,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_definitions_delete_at_management_group_request( @@ -2971,7 +2973,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinition] = kwargs.pop("cls", None) request = build_policy_definitions_get_at_management_group_request( @@ -3045,7 +3047,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3148,7 +3150,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3258,7 +3260,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicyDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3349,6 +3351,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -3432,7 +3435,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -3510,7 +3513,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_request( @@ -3567,7 +3570,7 @@ def get(self, policy_set_definition_name: str, **kwargs: Any) -> _models.PolicyS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_request( @@ -3627,7 +3630,7 @@ def get_built_in(self, policy_set_definition_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_built_in_request( @@ -3698,7 +3701,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3799,7 +3802,7 @@ def list_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -3967,7 +3970,7 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) @@ -4048,7 +4051,7 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_set_definitions_delete_at_management_group_request( @@ -4109,7 +4112,7 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinition] = kwargs.pop("cls", None) request = build_policy_set_definitions_get_at_management_group_request( @@ -4186,7 +4189,7 @@ def list_by_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-06-01")) cls: ClsType[_models.PolicySetDefinitionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py index 3afdef50379d5..a540a70bf19c8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py index 90f4f1ee687c1..320e1b04a2887 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_assignments = PolicyAssignmentsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py index c4a842087934d..80fe17aceb686 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/aio/operations/_operations.py @@ -66,6 +66,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( @@ -102,7 +103,7 @@ async def delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -251,7 +252,7 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -329,7 +330,7 @@ async def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -480,7 +481,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -569,7 +570,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -715,7 +716,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -830,7 +831,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -941,7 +942,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1042,7 +1043,7 @@ async def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1186,7 +1187,7 @@ async def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1263,7 +1264,7 @@ async def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1405,7 +1406,7 @@ async def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py index 6378acde12756..7c7dc484e0964 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_assignments_delete_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_policy_assignments_create_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_policy_assignments_get_request(scope: str, policy_assignment_name: str "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_policy_assignments_update_request(scope: str, policy_assignment_name: "policyAssignmentName": _SERIALIZER.url("policy_assignment_name", policy_assignment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,7 +177,7 @@ def build_policy_assignments_list_for_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -226,7 +226,7 @@ def build_policy_assignments_list_for_resource_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -259,7 +259,7 @@ def build_policy_assignments_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -291,7 +291,7 @@ def build_policy_assignments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -319,7 +319,7 @@ def build_policy_assignments_delete_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -344,7 +344,7 @@ def build_policy_assignments_create_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -370,7 +370,7 @@ def build_policy_assignments_get_by_id_request(policy_assignment_id: str, **kwar "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -395,7 +395,7 @@ def build_policy_assignments_update_by_id_request(policy_assignment_id: str, **k "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -426,6 +426,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Optional[_models.PolicyAssignment]: @@ -460,7 +461,7 @@ def delete(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> Opti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_request( @@ -609,7 +610,7 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -687,7 +688,7 @@ def get(self, scope: str, policy_assignment_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_request( @@ -838,7 +839,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -927,7 +928,7 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1073,7 +1074,7 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1188,7 +1189,7 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1299,7 +1300,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignmentListResult] = kwargs.pop("cls", None) error_map = { @@ -1400,7 +1401,7 @@ def delete_by_id(self, policy_assignment_id: str, **kwargs: Any) -> Optional[_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[Optional[_models.PolicyAssignment]] = kwargs.pop("cls", None) request = build_policy_assignments_delete_by_id_request( @@ -1544,7 +1545,7 @@ def create_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) @@ -1621,7 +1622,7 @@ def get_by_id(self, policy_assignment_id: str, **kwargs: Any) -> _models.PolicyA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) request = build_policy_assignments_get_by_id_request( @@ -1763,7 +1764,7 @@ def update_by_id( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyAssignment] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py index 2e72a192051bb..228912d7b1f04 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_exemptions = PolicyExemptionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-07-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py index 07fb1466af520..8c1e9bc31c59f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/_policy_client.py @@ -55,7 +55,7 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.policy_exemptions = PolicyExemptionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-07-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py index 8ce6388614364..a106c16078720 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -98,7 +99,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_exemptions_delete_request( @@ -244,7 +247,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -328,7 +333,9 @@ async def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) request = build_policy_exemptions_get_request( @@ -474,7 +481,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -553,7 +562,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -659,7 +670,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -799,7 +812,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -911,7 +926,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py index 592c4a55a041d..285bef91ade3c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_07_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_policy_exemptions_delete_request(scope: str, policy_exemption_name: st "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +83,7 @@ def build_policy_exemptions_create_or_update_request( "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,7 +112,7 @@ def build_policy_exemptions_get_request(scope: str, policy_exemption_name: str, "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,7 +140,7 @@ def build_policy_exemptions_update_request(scope: str, policy_exemption_name: st "policyExemptionName": _SERIALIZER.url("policy_exemption_name", policy_exemption_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,7 +170,7 @@ def build_policy_exemptions_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -204,7 +204,7 @@ def build_policy_exemptions_list_for_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -250,7 +250,7 @@ def build_policy_exemptions_list_for_resource_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -281,7 +281,7 @@ def build_policy_exemptions_list_for_management_group_request( "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -312,6 +312,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -348,7 +349,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_policy_exemptions_delete_request( @@ -494,7 +497,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -578,7 +583,9 @@ def get(self, scope: str, policy_exemption_name: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) request = build_policy_exemptions_get_request( @@ -724,7 +731,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PolicyExemption] = kwargs.pop("cls", None) @@ -803,7 +812,9 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -909,7 +920,9 @@ def list_for_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -1049,7 +1062,9 @@ def list_for_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { @@ -1161,7 +1176,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-07-01-preview") + ) cls: ClsType[_models.PolicyExemptionListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py index 20cd076e7950c..16e0a90c615e5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_policy_client.py @@ -57,8 +57,12 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.variables = VariablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.variable_values = VariableValuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.variables = VariablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" + ) + self.variable_values = VariableValuesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py index 64dc70e686179..24f2305145fd5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/_policy_client.py @@ -57,8 +57,12 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.variables = VariablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.variable_values = VariableValuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.variables = VariablesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" + ) + self.variable_values = VariableValuesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-08-01-preview" + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py index 835af4d07809c..f864c96c82741 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/aio/operations/_operations.py @@ -70,6 +70,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -97,7 +98,9 @@ async def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: di _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variables_delete_request( @@ -206,7 +209,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) @@ -283,7 +288,9 @@ async def get(self, variable_name: str, **kwargs: Any) -> _models.Variable: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_variables_get_request( @@ -347,7 +354,9 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variables_delete_at_management_group_request( @@ -474,7 +483,9 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) @@ -555,7 +566,9 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_variables_get_at_management_group_request( @@ -606,7 +619,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Variable"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -691,7 +706,9 @@ def list_for_management_group(self, management_group_id: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -780,6 +797,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -811,7 +829,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variable_values_delete_request( @@ -939,7 +959,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) @@ -1019,7 +1041,9 @@ async def get(self, variable_name: str, variable_value_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) request = build_variable_values_get_request( @@ -1074,7 +1098,9 @@ def list(self, variable_name: str, **kwargs: Any) -> AsyncIterable["_models.Vari _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None) error_map = { @@ -1167,7 +1193,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None) error_map = { @@ -1270,7 +1298,9 @@ async def delete_at_management_group( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variable_values_delete_at_management_group_request( @@ -1411,7 +1441,9 @@ async def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) @@ -1495,7 +1527,9 @@ async def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) request = build_variable_values_get_at_management_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py index c74679675ef5e..00eede72c4a78 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2022_08_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_variables_delete_request(variable_name: str, subscription_id: str, **k "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_variables_create_or_update_request(variable_name: str, subscription_id "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -110,7 +110,7 @@ def build_variables_get_request(variable_name: str, subscription_id: str, **kwar "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,7 +140,7 @@ def build_variables_delete_at_management_group_request( "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,7 +171,7 @@ def build_variables_create_or_update_at_management_group_request( "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -203,7 +203,7 @@ def build_variables_get_at_management_group_request( "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,7 +227,7 @@ def build_variables_list_request(subscription_id: str, **kwargs: Any) -> HttpReq "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,7 +254,7 @@ def build_variables_list_for_management_group_request(management_group_id: str, "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -285,7 +285,7 @@ def build_variable_values_delete_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -317,7 +317,7 @@ def build_variable_values_create_or_update_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -350,7 +350,7 @@ def build_variable_values_get_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -378,7 +378,7 @@ def build_variable_values_list_request(variable_name: str, subscription_id: str, "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -408,7 +408,7 @@ def build_variable_values_list_for_management_group_request( "variableName": _SERIALIZER.url("variable_name", variable_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -439,7 +439,7 @@ def build_variable_values_delete_at_management_group_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -471,7 +471,7 @@ def build_variable_values_create_or_update_at_management_group_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -504,7 +504,7 @@ def build_variable_values_get_at_management_group_request( "variableValueName": _SERIALIZER.url("variable_value_name", variable_value_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -533,6 +533,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -560,7 +561,9 @@ def delete(self, variable_name: str, **kwargs: Any) -> None: # pylint: disable= _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variables_delete_request( @@ -669,7 +672,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) @@ -746,7 +751,9 @@ def get(self, variable_name: str, **kwargs: Any) -> _models.Variable: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_variables_get_request( @@ -810,7 +817,9 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variables_delete_at_management_group_request( @@ -937,7 +946,9 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) @@ -1016,7 +1027,9 @@ def get_at_management_group(self, management_group_id: str, variable_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_variables_get_at_management_group_request( @@ -1067,7 +1080,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.Variable"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -1152,7 +1167,9 @@ def list_for_management_group(self, management_group_id: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -1241,6 +1258,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -1272,7 +1290,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variable_values_delete_request( @@ -1400,7 +1420,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) @@ -1480,7 +1502,9 @@ def get(self, variable_name: str, variable_value_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) request = build_variable_values_get_request( @@ -1535,7 +1559,9 @@ def list(self, variable_name: str, **kwargs: Any) -> Iterable["_models.VariableV _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None) error_map = { @@ -1628,7 +1654,9 @@ def list_for_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValueListResult] = kwargs.pop("cls", None) error_map = { @@ -1731,7 +1759,9 @@ def delete_at_management_group( # pylint: disable=inconsistent-return-statement _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_variable_values_delete_at_management_group_request( @@ -1872,7 +1902,9 @@ def create_or_update_at_management_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) @@ -1956,7 +1988,9 @@ def get_at_management_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2022-08-01-preview") + ) cls: ClsType[_models.VariableValue] = kwargs.pop("cls", None) request = build_variable_values_get_at_management_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_resource_private_link_client.py index 236df4f3222a8..3d234d2e2df1b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_resource_private_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_resource_private_link_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ResourcePrivateLinkClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ResourcePrivateLinkClient, self).__init__( @@ -104,7 +106,7 @@ def private_link_association(self): else: raise ValueError("API version {} does not have operation group 'private_link_association'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_management_private_link(self): @@ -118,7 +120,7 @@ def resource_management_private_link(self): else: raise ValueError("API version {} does not have operation group 'resource_management_private_link'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/aio/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/aio/_resource_private_link_client.py index c113edf6dafc6..b2df20219f5ff 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/aio/_resource_private_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/aio/_resource_private_link_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ResourcePrivateLinkClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ResourcePrivateLinkClient, self).__init__( @@ -104,7 +106,7 @@ def private_link_association(self): else: raise ValueError("API version {} does not have operation group 'private_link_association'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_management_private_link(self): @@ -118,7 +120,7 @@ def resource_management_private_link(self): else: raise ValueError("API version {} does not have operation group 'resource_management_private_link'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py index 5f08505e88e2f..8e8a7fe198d7d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_resource_private_link_client.py @@ -59,10 +59,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.private_link_association = PrivateLinkAssociationOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-05-01" ) self.resource_management_private_link = ResourceManagementPrivateLinkOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py index 5cde5e41edb45..94cb791804dee 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/_resource_private_link_client.py @@ -59,10 +59,10 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.private_link_association = PrivateLinkAssociationOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-05-01" ) self.resource_management_private_link = ResourceManagementPrivateLinkOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py index 5ad5e44661259..683ef4e1cf188 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/aio/operations/_operations.py @@ -60,6 +60,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def put( @@ -143,7 +144,7 @@ async def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkAssociation] = kwargs.pop("cls", None) @@ -219,7 +220,7 @@ async def get(self, group_id: str, pla_id: str, **kwargs: Any) -> _models.Privat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.PrivateLinkAssociation] = kwargs.pop("cls", None) request = build_private_link_association_get_request( @@ -281,7 +282,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_private_link_association_delete_request( @@ -335,7 +336,7 @@ async def list(self, group_id: str, **kwargs: Any) -> _models.PrivateLinkAssocia _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.PrivateLinkAssociationGetResult] = kwargs.pop("cls", None) request = build_private_link_association_list_request( @@ -389,6 +390,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def put( @@ -486,7 +488,7 @@ async def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceManagementPrivateLink] = kwargs.pop("cls", None) @@ -566,7 +568,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLink] = kwargs.pop("cls", None) request = build_resource_management_private_link_get_request( @@ -630,7 +632,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_management_private_link_delete_request( @@ -684,7 +686,7 @@ async def list(self, **kwargs: Any) -> _models.ResourceManagementPrivateLinkList _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLinkListResult] = kwargs.pop("cls", None) request = build_resource_management_private_link_list_request( @@ -745,7 +747,7 @@ async def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLinkListResult] = kwargs.pop("cls", None) request = build_resource_management_private_link_list_by_resource_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py index e3aa022a30418..71c14be2066a4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/operations/_operations.py @@ -26,7 +26,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +53,7 @@ def build_private_link_association_put_request(group_id: str, pla_id: str, **kwa "plaId": _SERIALIZER.url("pla_id", pla_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +83,7 @@ def build_private_link_association_get_request(group_id: str, pla_id: str, **kwa "plaId": _SERIALIZER.url("pla_id", pla_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,7 +111,7 @@ def build_private_link_association_delete_request(group_id: str, pla_id: str, ** "plaId": _SERIALIZER.url("pla_id", pla_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_private_link_association_list_request(group_id: str, **kwargs: Any) -> "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,7 +172,7 @@ def build_resource_management_private_link_put_request( "rmplName": _SERIALIZER.url("rmpl_name", rmpl_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -207,7 +207,7 @@ def build_resource_management_private_link_get_request( "rmplName": _SERIALIZER.url("rmpl_name", rmpl_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,7 +240,7 @@ def build_resource_management_private_link_delete_request( "rmplName": _SERIALIZER.url("rmpl_name", rmpl_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,7 +267,7 @@ def build_resource_management_private_link_list_request(subscription_id: str, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -299,7 +299,7 @@ def build_resource_management_private_link_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -328,6 +328,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def put( @@ -411,7 +412,7 @@ def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateLinkAssociation] = kwargs.pop("cls", None) @@ -487,7 +488,7 @@ def get(self, group_id: str, pla_id: str, **kwargs: Any) -> _models.PrivateLinkA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.PrivateLinkAssociation] = kwargs.pop("cls", None) request = build_private_link_association_get_request( @@ -549,7 +550,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_private_link_association_delete_request( @@ -603,7 +604,7 @@ def list(self, group_id: str, **kwargs: Any) -> _models.PrivateLinkAssociationGe _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.PrivateLinkAssociationGetResult] = kwargs.pop("cls", None) request = build_private_link_association_list_request( @@ -657,6 +658,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def put( @@ -754,7 +756,7 @@ def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceManagementPrivateLink] = kwargs.pop("cls", None) @@ -832,7 +834,7 @@ def get(self, resource_group_name: str, rmpl_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLink] = kwargs.pop("cls", None) request = build_resource_management_private_link_get_request( @@ -896,7 +898,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_management_private_link_delete_request( @@ -950,7 +952,7 @@ def list(self, **kwargs: Any) -> _models.ResourceManagementPrivateLinkListResult _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLinkListResult] = kwargs.pop("cls", None) request = build_resource_management_private_link_list_request( @@ -1011,7 +1013,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-05-01")) cls: ClsType[_models.ResourceManagementPrivateLinkListResult] = kwargs.pop("cls", None) request = build_resource_management_private_link_list_by_resource_group_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py index 55f4382f3c888..539e3474991ed 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_resource_management_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ResourceManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ResourceManagementClient, self).__init__( @@ -210,7 +212,7 @@ def deployment_operations(self): else: raise ValueError("API version {} does not have operation group 'deployment_operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def deployments(self): @@ -269,7 +271,7 @@ def deployments(self): else: raise ValueError("API version {} does not have operation group 'deployments'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def operations(self): @@ -316,7 +318,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def provider_resource_types(self): @@ -339,7 +341,7 @@ def provider_resource_types(self): else: raise ValueError("API version {} does not have operation group 'provider_resource_types'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def providers(self): @@ -398,7 +400,7 @@ def providers(self): else: raise ValueError("API version {} does not have operation group 'providers'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_groups(self): @@ -457,7 +459,7 @@ def resource_groups(self): else: raise ValueError("API version {} does not have operation group 'resource_groups'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resources(self): @@ -516,7 +518,7 @@ def resources(self): else: raise ValueError("API version {} does not have operation group 'resources'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def tags(self): @@ -575,7 +577,7 @@ def tags(self): else: raise ValueError("API version {} does not have operation group 'tags'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py index 072a73b86a978..bf395c6a018ae 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/aio/_resource_management_client.py @@ -71,6 +71,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = ResourceManagementClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(ResourceManagementClient, self).__init__( @@ -210,7 +212,7 @@ def deployment_operations(self): else: raise ValueError("API version {} does not have operation group 'deployment_operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def deployments(self): @@ -269,7 +271,7 @@ def deployments(self): else: raise ValueError("API version {} does not have operation group 'deployments'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def operations(self): @@ -316,7 +318,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def provider_resource_types(self): @@ -339,7 +341,7 @@ def provider_resource_types(self): else: raise ValueError("API version {} does not have operation group 'provider_resource_types'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def providers(self): @@ -398,7 +400,7 @@ def providers(self): else: raise ValueError("API version {} does not have operation group 'providers'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resource_groups(self): @@ -457,7 +459,7 @@ def resource_groups(self): else: raise ValueError("API version {} does not have operation group 'resource_groups'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def resources(self): @@ -516,7 +518,7 @@ def resources(self): else: raise ValueError("API version {} does not have operation group 'resources'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def tags(self): @@ -575,7 +577,7 @@ def tags(self): else: raise ValueError("API version {} does not have operation group 'tags'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py index 14f412e6e7664..cde79ffd10dec 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_resource_management_client.py @@ -76,13 +76,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-02-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py index a218f9c5ec446..ca83a2b01c398 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/_resource_management_client.py @@ -78,13 +78,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-02-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py index 2bf238a01ae7f..b3afc71f5c266 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/aio/operations/_operations.py @@ -97,6 +97,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -112,7 +113,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -169,7 +170,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -234,7 +235,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -282,7 +283,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -443,7 +444,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -513,7 +514,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -577,7 +578,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -698,7 +699,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -778,7 +779,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -837,7 +838,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -932,7 +933,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -988,6 +989,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1011,7 +1013,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1067,7 +1069,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -1121,7 +1123,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -1218,7 +1220,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -1272,6 +1274,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_resources( @@ -1306,7 +1309,7 @@ def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1401,7 +1404,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -1507,7 +1510,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -1571,7 +1574,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -1623,7 +1626,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1683,7 +1686,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -1801,7 +1804,7 @@ async def patch( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -1922,7 +1925,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -1990,7 +1993,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -2079,6 +2082,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _move_resources_initial( # pylint: disable=inconsistent-return-statements self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO], **kwargs: Any @@ -2094,7 +2098,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2227,7 +2231,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2294,7 +2298,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3074,6 +3078,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -3101,7 +3106,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -3156,7 +3161,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -3217,7 +3222,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -3277,7 +3282,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -3320,7 +3325,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -3407,6 +3412,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -3437,7 +3443,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -3497,7 +3503,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py index a5b31905a3275..d4c9c0e0ee201 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -64,7 +64,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +91,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,7 +122,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,7 +157,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,7 +187,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,7 +218,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -253,7 +253,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,7 +290,7 @@ def build_deployments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -345,7 +345,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -372,7 +372,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -398,7 +398,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -429,7 +429,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -466,7 +466,7 @@ def build_resource_groups_list_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -498,7 +498,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -525,7 +525,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -551,7 +551,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -575,7 +575,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -603,7 +603,7 @@ def build_resource_groups_patch_request(resource_group_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -637,7 +637,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -665,7 +665,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -704,7 +704,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -736,7 +736,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -782,7 +782,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -819,7 +819,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -860,7 +860,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -906,7 +906,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -951,7 +951,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -974,7 +974,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -999,7 +999,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1024,7 +1024,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1046,7 +1046,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1067,7 +1067,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1101,7 +1101,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1134,7 +1134,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1165,6 +1165,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -1180,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: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1237,7 +1238,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1302,7 +1303,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1350,7 +1351,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1511,7 +1512,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1581,7 +1582,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1645,7 +1646,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1766,7 +1767,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1846,7 +1847,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -1905,7 +1906,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2000,7 +2001,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2056,6 +2057,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2079,7 +2081,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2135,7 +2137,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2189,7 +2191,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2284,7 +2286,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2338,6 +2340,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_resources( @@ -2372,7 +2375,7 @@ def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2467,7 +2470,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -2573,7 +2576,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -2637,7 +2640,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -2689,7 +2692,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2749,7 +2752,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -2867,7 +2870,7 @@ def patch( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -2988,7 +2991,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -3056,7 +3059,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -3145,6 +3148,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _move_resources_initial( # pylint: disable=inconsistent-return-statements self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO], **kwargs: Any @@ -3160,7 +3164,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3293,7 +3297,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3360,7 +3364,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4140,6 +4144,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -4167,7 +4172,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -4222,7 +4227,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -4283,7 +4288,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -4343,7 +4348,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -4386,7 +4391,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -4473,6 +4478,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -4503,7 +4509,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -4563,7 +4569,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-02-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py index f8ab746754554..b52eb98851022 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_resource_management_client.py @@ -76,13 +76,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-09-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py index 00003570356cc..e1aad2af46c6a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/_resource_management_client.py @@ -78,13 +78,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-09-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2016-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py index bacfde86cb167..5fd98364b7e3d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/aio/operations/_operations.py @@ -102,6 +102,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -117,7 +118,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -183,7 +184,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -248,7 +249,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -296,7 +297,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -463,7 +464,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -533,7 +534,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -602,7 +603,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -726,7 +727,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -806,7 +807,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -867,7 +868,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -962,7 +963,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -1018,6 +1019,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1042,7 +1044,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1099,7 +1101,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -1155,7 +1157,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -1252,7 +1254,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -1306,6 +1308,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_resources( @@ -1339,7 +1342,7 @@ def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1434,7 +1437,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -1538,7 +1541,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -1602,7 +1605,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -1657,7 +1660,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1717,7 +1720,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -1839,7 +1842,7 @@ async def patch( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -1958,7 +1961,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -2026,7 +2029,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -2115,6 +2118,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _move_resources_initial( # pylint: disable=inconsistent-return-statements self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO], **kwargs: Any @@ -2130,7 +2134,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2278,7 +2282,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2345,7 +2349,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3928,6 +3932,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -3955,7 +3960,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -4010,7 +4015,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -4075,7 +4080,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -4137,7 +4142,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -4180,7 +4185,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -4267,6 +4272,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -4297,7 +4303,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -4357,7 +4363,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py index 13f814257aab9..6d6a529d0bab4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -66,7 +66,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,7 +95,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +128,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,7 +165,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,7 +230,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,7 +267,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -304,7 +304,7 @@ def build_deployments_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -359,7 +359,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -386,7 +386,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -412,7 +412,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -443,7 +443,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -480,7 +480,7 @@ def build_resource_groups_list_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -512,7 +512,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -539,7 +539,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -565,7 +565,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -589,7 +589,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -617,7 +617,7 @@ def build_resource_groups_patch_request(resource_group_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -651,7 +651,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -679,7 +679,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -718,7 +718,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -750,7 +750,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -796,7 +796,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -833,7 +833,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -874,7 +874,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -920,7 +920,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -965,7 +965,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -985,7 +985,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1002,7 +1002,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1023,7 +1023,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1049,7 +1049,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1074,7 +1074,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1097,7 +1097,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1122,7 +1122,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1147,7 +1147,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1169,7 +1169,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1190,7 +1190,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1226,7 +1226,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1261,7 +1261,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1292,6 +1292,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -1307,7 +1308,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1373,7 +1374,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1438,7 +1439,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1486,7 +1487,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1653,7 +1654,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1723,7 +1724,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1792,7 +1793,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1916,7 +1917,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1996,7 +1997,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -2057,7 +2058,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2152,7 +2153,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2208,6 +2209,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2232,7 +2234,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2289,7 +2291,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2345,7 +2347,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2440,7 +2442,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2494,6 +2496,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_resources( @@ -2527,7 +2530,7 @@ def list_resources( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2622,7 +2625,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -2726,7 +2729,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -2790,7 +2793,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -2845,7 +2848,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2905,7 +2908,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -3027,7 +3030,7 @@ def patch( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -3146,7 +3149,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -3214,7 +3217,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -3303,6 +3306,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _move_resources_initial( # pylint: disable=inconsistent-return-statements self, source_resource_group_name: str, parameters: Union[_models.ResourcesMoveInfo, IO], **kwargs: Any @@ -3318,7 +3322,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3466,7 +3470,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3533,7 +3537,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5116,6 +5120,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -5143,7 +5148,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5198,7 +5203,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -5263,7 +5268,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -5325,7 +5330,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -5368,7 +5373,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -5455,6 +5460,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -5485,7 +5491,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -5545,7 +5551,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py index 0cf487fce2716..60a107cd23a5f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_resource_management_client.py @@ -76,13 +76,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2017-05-10") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py index 2913f882d88cd..c1a724944cee9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/_resource_management_client.py @@ -78,13 +78,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2017-05-10") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2017-05-10" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py index cb78cbe00c3a5..bd16b5e728ee6 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/aio/operations/_operations.py @@ -103,6 +103,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -118,7 +119,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -184,7 +185,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -249,7 +250,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -297,7 +298,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -464,7 +465,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -534,7 +535,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -603,7 +604,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -727,7 +728,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -807,7 +808,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -868,7 +869,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -963,7 +964,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -1019,6 +1020,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1043,7 +1045,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1100,7 +1102,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -1156,7 +1158,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -1253,7 +1255,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -1307,6 +1309,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -1340,7 +1343,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1428,7 +1431,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1576,7 +1579,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1632,7 +1635,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1786,7 +1789,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1853,7 +1856,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3436,6 +3439,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -3460,7 +3464,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -3564,7 +3568,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -3628,7 +3632,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -3683,7 +3687,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3743,7 +3747,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -3866,7 +3870,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -3985,7 +3989,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -4053,7 +4057,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -4142,6 +4146,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -4169,7 +4174,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -4224,7 +4229,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -4289,7 +4294,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -4351,7 +4356,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -4394,7 +4399,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -4481,6 +4486,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -4511,7 +4517,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -4571,7 +4577,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py index 4502413c90c5e..158538d34d7fc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -66,7 +66,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,7 +95,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +128,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,7 +165,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,7 +230,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,7 +267,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -304,7 +304,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -359,7 +359,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -386,7 +386,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -412,7 +412,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -443,7 +443,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -480,7 +480,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -521,7 +521,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -557,7 +557,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -589,7 +589,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -635,7 +635,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -672,7 +672,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -713,7 +713,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -759,7 +759,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -804,7 +804,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -824,7 +824,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -841,7 +841,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -862,7 +862,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -888,7 +888,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -913,7 +913,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -939,7 +939,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -966,7 +966,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -992,7 +992,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1016,7 +1016,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1044,7 +1044,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1078,7 +1078,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1106,7 +1106,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1133,7 +1133,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1158,7 +1158,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1183,7 +1183,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1205,7 +1205,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1226,7 +1226,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1262,7 +1262,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1297,7 +1297,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1328,6 +1328,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -1343,7 +1344,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1409,7 +1410,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1475,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1522,7 +1523,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1689,7 +1690,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1759,7 +1760,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1828,7 +1829,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1952,7 +1953,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2032,7 +2033,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -2093,7 +2094,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2188,7 +2189,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2244,6 +2245,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2268,7 +2270,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2325,7 +2327,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2381,7 +2383,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2476,7 +2478,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2530,6 +2532,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -2563,7 +2566,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2651,7 +2654,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2799,7 +2802,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2855,7 +2858,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3009,7 +3012,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3076,7 +3079,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4659,6 +4662,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -4683,7 +4687,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -4787,7 +4791,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4851,7 +4855,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -4906,7 +4910,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4966,7 +4970,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -5089,7 +5093,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5208,7 +5212,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -5276,7 +5280,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -5365,6 +5369,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -5392,7 +5397,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5447,7 +5452,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -5512,7 +5517,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -5574,7 +5579,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -5617,7 +5622,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -5704,6 +5709,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -5734,7 +5740,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -5794,7 +5800,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2017-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py index 62e3c82e1b9e1..9b69aba44f6e2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_resource_management_client.py @@ -76,13 +76,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-02-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py index 6ae1d7cb93b5d..eeec742445113 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/_resource_management_client.py @@ -78,13 +78,21 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-02-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py index fceb5393244e7..8bc0f69ef2109 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/aio/operations/_operations.py @@ -103,6 +103,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -118,7 +119,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -184,7 +185,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -249,7 +250,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -297,7 +298,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -464,7 +465,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -534,7 +535,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -603,7 +604,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -727,7 +728,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -807,7 +808,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -868,7 +869,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -963,7 +964,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -1019,6 +1020,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1043,7 +1045,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1100,7 +1102,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -1156,7 +1158,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -1253,7 +1255,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -1307,6 +1309,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -1340,7 +1343,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -1428,7 +1431,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1576,7 +1579,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1632,7 +1635,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1786,7 +1789,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1851,7 +1854,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3434,6 +3437,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -3458,7 +3462,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -3562,7 +3566,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -3626,7 +3630,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -3681,7 +3685,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3741,7 +3745,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -3864,7 +3868,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -3983,7 +3987,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -4051,7 +4055,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -4140,6 +4144,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -4167,7 +4172,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -4222,7 +4227,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -4287,7 +4292,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -4349,7 +4354,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -4392,7 +4397,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -4479,6 +4484,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get( @@ -4509,7 +4515,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -4569,7 +4575,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py index 03d79e57a86da..a5e74e54b3156 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_02_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -66,7 +66,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,7 +95,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +128,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,7 +165,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,7 +230,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,7 +267,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -304,7 +304,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -359,7 +359,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -386,7 +386,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -412,7 +412,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -443,7 +443,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -480,7 +480,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -521,7 +521,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -557,7 +557,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -589,7 +589,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -635,7 +635,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -672,7 +672,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -713,7 +713,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -759,7 +759,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -804,7 +804,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -824,7 +824,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -841,7 +841,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -862,7 +862,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -888,7 +888,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -913,7 +913,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -939,7 +939,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -966,7 +966,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -992,7 +992,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1016,7 +1016,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1044,7 +1044,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1078,7 +1078,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1106,7 +1106,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1133,7 +1133,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1158,7 +1158,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1183,7 +1183,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1205,7 +1205,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1226,7 +1226,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1262,7 +1262,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1297,7 +1297,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1328,6 +1328,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, deployment_name: str, **kwargs: Any @@ -1343,7 +1344,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1409,7 +1410,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1474,7 +1475,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1522,7 +1523,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1689,7 +1690,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1759,7 +1760,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1828,7 +1829,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1952,7 +1953,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2032,7 +2033,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -2093,7 +2094,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2188,7 +2189,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2244,6 +2245,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2268,7 +2270,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2325,7 +2327,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2381,7 +2383,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2476,7 +2478,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2530,6 +2532,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -2563,7 +2566,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2651,7 +2654,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2799,7 +2802,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2855,7 +2858,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3009,7 +3012,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3074,7 +3077,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4657,6 +4660,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -4681,7 +4685,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -4785,7 +4789,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4849,7 +4853,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -4904,7 +4908,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4964,7 +4968,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -5087,7 +5091,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5206,7 +5210,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -5274,7 +5278,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -5363,6 +5367,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -5390,7 +5395,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5445,7 +5450,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -5510,7 +5515,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -5572,7 +5577,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -5615,7 +5620,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -5702,6 +5707,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get( @@ -5732,7 +5738,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -5792,7 +5798,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-02-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py index 09906ea088b54..c28578f57490b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2018-05-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-05-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py index 5caff00288105..6e06e0343122c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2018-05-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-05-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2018-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py index 8ffbb93dbe54b..1387b4e0e7e9f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/operations/_operations.py @@ -114,6 +114,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -128,7 +129,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -214,6 +215,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-return-statements self, deployment_name: str, **kwargs: Any @@ -229,7 +231,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -290,7 +292,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -351,7 +353,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -398,7 +400,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -548,7 +550,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -614,7 +616,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -679,7 +681,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -786,7 +788,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -862,7 +864,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -919,7 +921,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1005,7 +1007,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1071,7 +1073,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1136,7 +1138,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1184,7 +1186,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1351,7 +1353,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1421,7 +1423,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1490,7 +1492,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1614,7 +1616,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1694,7 +1696,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -1755,7 +1757,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1850,7 +1852,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -1906,6 +1908,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1930,7 +1933,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1987,7 +1990,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2043,7 +2046,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2140,7 +2143,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2194,6 +2197,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -2240,7 +2244,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2328,7 +2332,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2476,7 +2480,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2532,7 +2536,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2686,7 +2690,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2766,7 +2770,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4349,6 +4353,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -4373,7 +4378,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -4483,7 +4488,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4547,7 +4552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -4602,7 +4607,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4662,7 +4667,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -4785,7 +4790,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4904,7 +4909,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -4974,7 +4979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -5063,6 +5068,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -5090,7 +5096,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5145,7 +5151,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -5210,7 +5216,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -5272,7 +5278,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -5315,7 +5321,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -5402,6 +5408,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_subscription_scope( @@ -5429,7 +5436,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -5485,7 +5492,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -5586,7 +5593,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -5646,7 +5653,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py index 35845baa4f9ff..da6a205c97f7d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -81,7 +81,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -106,7 +106,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,7 +168,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,7 +227,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,7 +261,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -287,7 +287,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -323,7 +323,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,7 +352,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -385,7 +385,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -422,7 +422,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -454,7 +454,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -487,7 +487,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,7 +524,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -561,7 +561,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -616,7 +616,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -643,7 +643,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -669,7 +669,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -700,7 +700,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -737,7 +737,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -778,7 +778,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -814,7 +814,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -846,7 +846,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -892,7 +892,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -929,7 +929,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -970,7 +970,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1016,7 +1016,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1061,7 +1061,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1098,7 +1098,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1119,7 +1119,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1145,7 +1145,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1170,7 +1170,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1196,7 +1196,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1223,7 +1223,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1249,7 +1249,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1273,7 +1273,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1301,7 +1301,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1335,7 +1335,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1390,7 +1390,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1415,7 +1415,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1440,7 +1440,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1462,7 +1462,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1483,7 +1483,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1516,7 +1516,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1548,7 +1548,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1586,7 +1586,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1621,7 +1621,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1652,6 +1652,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -1666,7 +1667,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -1752,6 +1753,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-return-statements self, deployment_name: str, **kwargs: Any @@ -1767,7 +1769,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -1828,7 +1830,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1889,7 +1891,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -1936,7 +1938,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2086,7 +2088,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2152,7 +2154,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -2217,7 +2219,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -2324,7 +2326,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2400,7 +2402,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -2457,7 +2459,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2543,7 +2545,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -2609,7 +2611,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2674,7 +2676,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -2722,7 +2724,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2889,7 +2891,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2959,7 +2961,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -3028,7 +3030,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -3152,7 +3154,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3232,7 +3234,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -3293,7 +3295,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3388,7 +3390,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -3444,6 +3446,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -3468,7 +3471,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -3525,7 +3528,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -3581,7 +3584,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -3676,7 +3679,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -3730,6 +3733,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -3776,7 +3780,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3864,7 +3868,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -4012,7 +4016,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4068,7 +4072,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -4222,7 +4226,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4302,7 +4306,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5885,6 +5889,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -5909,7 +5914,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -6019,7 +6024,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -6083,7 +6088,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -6138,7 +6143,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6198,7 +6203,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -6321,7 +6326,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -6440,7 +6445,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -6510,7 +6515,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -6599,6 +6604,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -6626,7 +6632,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -6681,7 +6687,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -6746,7 +6752,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -6808,7 +6814,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -6851,7 +6857,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -6938,6 +6944,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_subscription_scope( @@ -6965,7 +6972,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -7021,7 +7028,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -7122,7 +7129,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -7182,7 +7189,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py index 025352c17f0be..458a2fbf08d1e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-03-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-03-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py index b391ee7952f1b..78b877085d425 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-03-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-03-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-03-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py index 373636c07b854..aa517380409bf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/aio/operations/_operations.py @@ -114,6 +114,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -128,7 +129,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -214,6 +215,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-return-statements self, deployment_name: str, **kwargs: Any @@ -229,7 +231,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -290,7 +292,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -351,7 +353,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -398,7 +400,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -548,7 +550,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -614,7 +616,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -679,7 +681,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -786,7 +788,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -862,7 +864,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -919,7 +921,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1005,7 +1007,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1071,7 +1073,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1136,7 +1138,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -1184,7 +1186,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1351,7 +1353,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1421,7 +1423,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -1490,7 +1492,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -1614,7 +1616,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1694,7 +1696,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -1755,7 +1757,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1850,7 +1852,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -1906,6 +1908,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -1930,7 +1933,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -1987,7 +1990,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2043,7 +2046,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2140,7 +2143,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -2194,6 +2197,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -2240,7 +2244,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -2328,7 +2332,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2476,7 +2480,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2532,7 +2536,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2686,7 +2690,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2766,7 +2770,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4349,6 +4353,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -4373,7 +4378,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -4483,7 +4488,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4547,7 +4552,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -4602,7 +4607,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4662,7 +4667,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -4785,7 +4790,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -4904,7 +4909,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -4974,7 +4979,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -5063,6 +5068,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -5090,7 +5096,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5145,7 +5151,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -5210,7 +5216,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -5272,7 +5278,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -5315,7 +5321,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -5402,6 +5408,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_subscription_scope( @@ -5429,7 +5436,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -5485,7 +5492,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -5586,7 +5593,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -5646,7 +5653,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py index ead52ee4a8e60..00d3e0a5660fa 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_03_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -81,7 +81,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -106,7 +106,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -168,7 +168,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +197,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,7 +227,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,7 +261,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -287,7 +287,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -323,7 +323,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -352,7 +352,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -385,7 +385,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -422,7 +422,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -454,7 +454,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -487,7 +487,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,7 +524,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -561,7 +561,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -616,7 +616,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -643,7 +643,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -669,7 +669,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -700,7 +700,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -737,7 +737,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -778,7 +778,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -814,7 +814,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -846,7 +846,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -892,7 +892,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -929,7 +929,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -970,7 +970,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1016,7 +1016,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1061,7 +1061,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1098,7 +1098,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1119,7 +1119,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1145,7 +1145,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1170,7 +1170,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1196,7 +1196,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1223,7 +1223,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1249,7 +1249,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1273,7 +1273,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1301,7 +1301,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1335,7 +1335,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1390,7 +1390,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1415,7 +1415,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1440,7 +1440,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1462,7 +1462,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1483,7 +1483,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1516,7 +1516,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1548,7 +1548,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1586,7 +1586,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1621,7 +1621,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1652,6 +1652,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -1666,7 +1667,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -1752,6 +1753,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-return-statements self, deployment_name: str, **kwargs: Any @@ -1767,7 +1769,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -1828,7 +1830,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1889,7 +1891,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -1936,7 +1938,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2086,7 +2088,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2152,7 +2154,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -2217,7 +2219,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -2324,7 +2326,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2400,7 +2402,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -2457,7 +2459,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2543,7 +2545,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -2609,7 +2611,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2674,7 +2676,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -2722,7 +2724,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2889,7 +2891,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2959,7 +2961,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -3028,7 +3030,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -3152,7 +3154,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3232,7 +3234,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -3293,7 +3295,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3388,7 +3390,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -3444,6 +3446,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -3468,7 +3471,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -3525,7 +3528,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -3581,7 +3584,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -3676,7 +3679,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -3730,6 +3733,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -3776,7 +3780,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3864,7 +3868,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -4012,7 +4016,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4068,7 +4072,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -4222,7 +4226,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4302,7 +4306,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5885,6 +5889,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -5909,7 +5914,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -6019,7 +6024,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -6083,7 +6088,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -6138,7 +6143,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6198,7 +6203,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -6321,7 +6326,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -6440,7 +6445,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -6510,7 +6515,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -6599,6 +6604,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -6626,7 +6632,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -6681,7 +6687,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -6746,7 +6752,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -6808,7 +6814,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -6851,7 +6857,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -6938,6 +6944,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_subscription_scope( @@ -6965,7 +6972,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -7021,7 +7028,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -7122,7 +7129,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -7182,7 +7189,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-03-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-03-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py index 25faf4031bcd0..9ebe9297d74ca 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-05-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-05-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py index d70b54af0935f..66f8c73c3c0e9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-05-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-05-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py index f98682cc97c99..3ff3c1b1dbdff 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/aio/operations/_operations.py @@ -124,6 +124,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -138,7 +139,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -224,6 +225,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-return-statements self, group_id: str, deployment_name: str, **kwargs: Any @@ -239,7 +241,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -304,7 +306,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -370,7 +372,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -417,7 +419,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -580,7 +582,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -651,7 +653,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -718,7 +720,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -838,7 +840,7 @@ async def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -916,7 +918,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -975,7 +977,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1061,7 +1063,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -1122,7 +1124,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1183,7 +1185,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -1230,7 +1232,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1380,7 +1382,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1446,7 +1448,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -1511,7 +1513,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -1618,7 +1620,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1694,7 +1696,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -1751,7 +1753,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1837,7 +1839,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1903,7 +1905,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1968,7 +1970,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -2016,7 +2018,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2183,7 +2185,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2253,7 +2255,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -2322,7 +2324,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -2446,7 +2448,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2526,7 +2528,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -2587,7 +2589,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2682,7 +2684,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2738,6 +2740,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2762,7 +2765,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2819,7 +2822,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2875,7 +2878,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2972,7 +2975,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -3026,6 +3029,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -3072,7 +3076,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3160,7 +3164,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3308,7 +3312,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3364,7 +3368,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3518,7 +3522,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3598,7 +3602,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5181,6 +5185,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -5205,7 +5210,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -5315,7 +5320,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5379,7 +5384,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -5434,7 +5439,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5494,7 +5499,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -5617,7 +5622,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5736,7 +5741,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -5806,7 +5811,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -5895,6 +5900,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -5922,7 +5928,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -5977,7 +5983,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -6042,7 +6048,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -6104,7 +6110,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -6147,7 +6153,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -6234,6 +6240,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_management_group_scope( @@ -6263,7 +6270,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -6321,7 +6328,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -6419,7 +6426,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -6475,7 +6482,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -6576,7 +6583,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -6636,7 +6643,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py index ea14ea6027bf8..c9d17aff5bc69 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -82,7 +82,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -108,7 +108,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,7 +172,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -201,7 +201,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,7 +231,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,7 +265,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -294,7 +294,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -326,7 +326,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -351,7 +351,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -442,7 +442,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -472,7 +472,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -506,7 +506,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -532,7 +532,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -568,7 +568,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -597,7 +597,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -630,7 +630,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -667,7 +667,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -699,7 +699,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -732,7 +732,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -769,7 +769,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -806,7 +806,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -861,7 +861,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -888,7 +888,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -945,7 +945,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -982,7 +982,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1023,7 +1023,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1059,7 +1059,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1091,7 +1091,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1137,7 +1137,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1174,7 +1174,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1215,7 +1215,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1261,7 +1261,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1306,7 +1306,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1326,7 +1326,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1343,7 +1343,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1364,7 +1364,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1390,7 +1390,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1415,7 +1415,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1441,7 +1441,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1468,7 +1468,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1494,7 +1494,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1518,7 +1518,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1546,7 +1546,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1580,7 +1580,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1608,7 +1608,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1635,7 +1635,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1660,7 +1660,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1685,7 +1685,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1707,7 +1707,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1728,7 +1728,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1761,7 +1761,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1793,7 +1793,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1828,7 +1828,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1860,7 +1860,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1898,7 +1898,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1933,7 +1933,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1964,6 +1964,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -1978,7 +1979,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2064,6 +2065,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-return-statements self, group_id: str, deployment_name: str, **kwargs: Any @@ -2079,7 +2081,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2144,7 +2146,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2208,7 +2210,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2255,7 +2257,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2418,7 +2420,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2489,7 +2491,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2556,7 +2558,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2676,7 +2678,7 @@ def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2754,7 +2756,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -2813,7 +2815,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2899,7 +2901,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -2960,7 +2962,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3021,7 +3023,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3068,7 +3070,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3218,7 +3220,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3284,7 +3286,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3349,7 +3351,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3456,7 +3458,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3532,7 +3534,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -3589,7 +3591,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3675,7 +3677,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -3741,7 +3743,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3806,7 +3808,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -3854,7 +3856,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4021,7 +4023,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4091,7 +4093,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4160,7 +4162,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4284,7 +4286,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4364,7 +4366,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -4425,7 +4427,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4520,7 +4522,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -4576,6 +4578,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -4600,7 +4603,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -4657,7 +4660,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -4713,7 +4716,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -4808,7 +4811,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -4862,6 +4865,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -4908,7 +4912,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -4996,7 +5000,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5144,7 +5148,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5200,7 +5204,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5354,7 +5358,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5434,7 +5438,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7017,6 +7021,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -7041,7 +7046,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -7151,7 +7156,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7215,7 +7220,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -7270,7 +7275,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7330,7 +7335,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -7453,7 +7458,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7572,7 +7577,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -7642,7 +7647,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -7731,6 +7736,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -7758,7 +7764,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -7813,7 +7819,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -7878,7 +7884,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -7940,7 +7946,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -7983,7 +7989,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -8070,6 +8076,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_management_group_scope( @@ -8099,7 +8106,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -8157,7 +8164,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8255,7 +8262,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -8311,7 +8318,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8412,7 +8419,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -8472,7 +8479,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py index 61039fb093819..b2f386d76b21e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-05-10") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-05-10") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py index 4ab9ec80701e4..0e4dbec1862e4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-05-10") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-05-10") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-05-10" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py index 74a6073c1345f..1afcd76a95003 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/aio/operations/_operations.py @@ -126,6 +126,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -140,7 +141,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -226,6 +227,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-return-statements self, group_id: str, deployment_name: str, **kwargs: Any @@ -241,7 +243,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -306,7 +308,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -372,7 +374,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -419,7 +421,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -582,7 +584,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -653,7 +655,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -720,7 +722,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -840,7 +842,7 @@ async def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -918,7 +920,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -977,7 +979,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1063,7 +1065,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -1124,7 +1126,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1185,7 +1187,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -1232,7 +1234,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1382,7 +1384,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1448,7 +1450,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -1513,7 +1515,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -1620,7 +1622,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1696,7 +1698,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -1753,7 +1755,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1839,7 +1841,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -1905,7 +1907,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1970,7 +1972,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -2018,7 +2020,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2185,7 +2187,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2255,7 +2257,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -2324,7 +2326,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -2448,7 +2450,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2528,7 +2530,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -2589,7 +2591,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2684,7 +2686,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -2740,6 +2742,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -2764,7 +2767,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -2821,7 +2824,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -2877,7 +2880,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -2969,7 +2972,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -3065,7 +3068,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -3127,7 +3130,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -3180,6 +3183,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -3226,7 +3230,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -3314,7 +3318,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3462,7 +3466,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3518,7 +3522,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -3672,7 +3676,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3752,7 +3756,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5335,6 +5339,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -5359,7 +5364,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -5469,7 +5474,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5533,7 +5538,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -5588,7 +5593,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5648,7 +5653,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -5771,7 +5776,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -5890,7 +5895,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -5960,7 +5965,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -6049,6 +6054,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -6076,7 +6082,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -6131,7 +6137,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -6196,7 +6202,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -6258,7 +6264,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -6301,7 +6307,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -6388,6 +6394,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_management_group_scope( @@ -6417,7 +6424,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -6475,7 +6482,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -6573,7 +6580,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -6629,7 +6636,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -6730,7 +6737,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -6790,7 +6797,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py index 131f339ca75c8..bc3eed419d12f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_05_10/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -82,7 +82,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -108,7 +108,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,7 +172,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -201,7 +201,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,7 +231,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,7 +265,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -294,7 +294,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -326,7 +326,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -351,7 +351,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -442,7 +442,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -472,7 +472,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -506,7 +506,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -532,7 +532,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -568,7 +568,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -597,7 +597,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -630,7 +630,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -667,7 +667,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -699,7 +699,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -732,7 +732,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -769,7 +769,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -806,7 +806,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -861,7 +861,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -888,7 +888,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -970,7 +970,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -998,7 +998,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1035,7 +1035,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1076,7 +1076,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1112,7 +1112,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1144,7 +1144,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1190,7 +1190,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1227,7 +1227,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1268,7 +1268,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1314,7 +1314,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1359,7 +1359,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1379,7 +1379,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1396,7 +1396,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1417,7 +1417,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1443,7 +1443,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1468,7 +1468,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1494,7 +1494,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1521,7 +1521,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1547,7 +1547,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1571,7 +1571,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1599,7 +1599,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1633,7 +1633,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1661,7 +1661,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1688,7 +1688,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1713,7 +1713,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1738,7 +1738,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1760,7 +1760,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1781,7 +1781,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1814,7 +1814,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1846,7 +1846,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1881,7 +1881,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1913,7 +1913,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1951,7 +1951,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1986,7 +1986,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2017,6 +2017,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2031,7 +2032,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2117,6 +2118,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-return-statements self, group_id: str, deployment_name: str, **kwargs: Any @@ -2132,7 +2134,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2197,7 +2199,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2261,7 +2263,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2308,7 +2310,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2471,7 +2473,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2542,7 +2544,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2609,7 +2611,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2729,7 +2731,7 @@ def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2807,7 +2809,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -2866,7 +2868,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2952,7 +2954,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3013,7 +3015,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3074,7 +3076,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3121,7 +3123,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3271,7 +3273,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3337,7 +3339,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3402,7 +3404,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3509,7 +3511,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3585,7 +3587,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -3642,7 +3644,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3728,7 +3730,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -3794,7 +3796,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3859,7 +3861,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -3907,7 +3909,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4074,7 +4076,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4144,7 +4146,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4213,7 +4215,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4337,7 +4339,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4417,7 +4419,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -4478,7 +4480,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4573,7 +4575,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -4629,6 +4631,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -4653,7 +4656,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -4710,7 +4713,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -4766,7 +4769,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -4858,7 +4861,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -4952,7 +4955,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -5014,7 +5017,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -5067,6 +5070,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -5113,7 +5117,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5201,7 +5205,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5349,7 +5353,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5405,7 +5409,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5559,7 +5563,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5639,7 +5643,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7222,6 +7226,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -7246,7 +7251,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -7356,7 +7361,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7420,7 +7425,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -7475,7 +7480,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7535,7 +7540,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -7658,7 +7663,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7777,7 +7782,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -7847,7 +7852,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -7936,6 +7941,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -7963,7 +7969,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -8018,7 +8024,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -8083,7 +8089,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -8145,7 +8151,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -8188,7 +8194,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -8275,6 +8281,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_management_group_scope( @@ -8304,7 +8311,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -8362,7 +8369,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8460,7 +8467,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -8516,7 +8523,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8617,7 +8624,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -8677,7 +8684,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-05-10")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-05-10")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py index e6bd9007e221b..a6e572953e0fe 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-07-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-07-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py index 226db57c5df49..31d7440bf941c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-07-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-07-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-07-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py index 4347b54f2950b..c978d2bb20db1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/aio/operations/_operations.py @@ -148,6 +148,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -162,7 +163,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -248,6 +249,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -263,7 +265,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -324,7 +326,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -386,7 +388,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -431,7 +433,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -588,7 +590,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -657,7 +659,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -722,7 +724,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -834,7 +836,7 @@ async def validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -910,7 +912,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -969,7 +971,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1053,7 +1055,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1111,7 +1113,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1170,7 +1172,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1214,7 +1216,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1363,7 +1365,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1429,7 +1431,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1491,7 +1493,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1595,7 +1597,7 @@ async def validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1668,7 +1670,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -1724,7 +1726,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1807,7 +1809,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -1872,7 +1874,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1938,7 +1940,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -1985,7 +1987,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2148,7 +2150,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2219,7 +2221,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2286,7 +2288,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2406,7 +2408,7 @@ async def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2484,7 +2486,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -2543,7 +2545,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2629,7 +2631,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -2690,7 +2692,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2751,7 +2753,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -2798,7 +2800,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2948,7 +2950,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3014,7 +3016,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3079,7 +3081,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3186,7 +3188,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3252,7 +3254,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3402,7 +3404,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3472,7 +3474,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -3529,7 +3531,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3615,7 +3617,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -3681,7 +3683,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3746,7 +3748,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -3794,7 +3796,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3961,7 +3963,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4031,7 +4033,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4100,7 +4102,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4224,7 +4226,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4295,7 +4297,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4466,7 +4468,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4540,7 +4542,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -4601,7 +4603,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4696,7 +4698,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -4752,6 +4754,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -4776,7 +4779,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -4833,7 +4836,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -4889,7 +4892,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -4981,7 +4984,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5077,7 +5080,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -5139,7 +5142,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -5192,6 +5195,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -5238,7 +5242,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5326,7 +5330,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5474,7 +5478,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5530,7 +5534,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5684,7 +5688,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5764,7 +5768,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7347,6 +7351,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -7371,7 +7376,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -7481,7 +7486,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7545,7 +7550,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -7600,7 +7605,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7660,7 +7665,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -7783,7 +7788,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7902,7 +7907,7 @@ async def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -7972,7 +7977,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -8061,6 +8066,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -8088,7 +8094,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -8143,7 +8149,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -8208,7 +8214,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -8270,7 +8276,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -8313,7 +8319,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -8400,6 +8406,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -8429,7 +8436,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -8487,7 +8494,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8583,7 +8590,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -8638,7 +8645,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8735,7 +8742,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -8793,7 +8800,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8891,7 +8898,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -8947,7 +8954,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -9048,7 +9055,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -9108,7 +9115,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py index 1ac14f228f344..64477de9ebd14 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_07_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -468,7 +468,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -525,7 +525,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -557,7 +557,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -590,7 +590,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -624,7 +624,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -656,7 +656,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -689,7 +689,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -723,7 +723,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -752,7 +752,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -787,7 +787,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -818,7 +818,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -850,7 +850,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -883,7 +883,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -915,7 +915,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -948,7 +948,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -983,7 +983,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1017,7 +1017,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1043,7 +1043,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1082,7 +1082,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1117,7 +1117,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1153,7 +1153,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1190,7 +1190,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1225,7 +1225,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1261,7 +1261,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1299,7 +1299,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1336,7 +1336,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1373,7 +1373,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1428,7 +1428,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1455,7 +1455,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1481,7 +1481,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1537,7 +1537,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1565,7 +1565,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1602,7 +1602,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1645,7 +1645,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1684,7 +1684,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1717,7 +1717,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1766,7 +1766,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1809,7 +1809,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1853,7 +1853,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1899,7 +1899,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1944,7 +1944,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1967,7 +1967,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1990,7 +1990,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2014,7 +2014,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2040,7 +2040,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2065,7 +2065,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2094,7 +2094,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2124,7 +2124,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2153,7 +2153,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2180,7 +2180,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2208,7 +2208,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2242,7 +2242,7 @@ def build_resource_groups_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2270,7 +2270,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2300,7 +2300,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2328,7 +2328,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2353,7 +2353,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2378,7 +2378,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2402,7 +2402,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2434,7 +2434,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2463,7 +2463,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2496,7 +2496,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2524,7 +2524,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2559,7 +2559,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2591,7 +2591,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2626,7 +2626,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2658,7 +2658,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2696,7 +2696,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2731,7 +2731,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2762,6 +2762,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2776,7 +2777,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2862,6 +2863,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -2877,7 +2879,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -2938,7 +2940,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3000,7 +3002,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3045,7 +3047,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3202,7 +3204,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3271,7 +3273,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3336,7 +3338,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3448,7 +3450,7 @@ def validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3524,7 +3526,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3583,7 +3585,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3667,7 +3669,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -3725,7 +3727,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3784,7 +3786,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -3828,7 +3830,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3977,7 +3979,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4043,7 +4045,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4105,7 +4107,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4209,7 +4211,7 @@ def validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4280,7 +4282,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4336,7 +4338,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4419,7 +4421,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -4484,7 +4486,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4548,7 +4550,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -4595,7 +4597,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4758,7 +4760,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4829,7 +4831,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -4896,7 +4898,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5016,7 +5018,7 @@ def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -5094,7 +5096,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -5153,7 +5155,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5239,7 +5241,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -5300,7 +5302,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5361,7 +5363,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -5408,7 +5410,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5558,7 +5560,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5624,7 +5626,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -5689,7 +5691,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -5796,7 +5798,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -5862,7 +5864,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6012,7 +6014,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6082,7 +6084,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -6139,7 +6141,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6225,7 +6227,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -6291,7 +6293,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6356,7 +6358,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -6404,7 +6406,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6571,7 +6573,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6641,7 +6643,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -6710,7 +6712,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -6834,7 +6836,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -6905,7 +6907,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -7076,7 +7078,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7150,7 +7152,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -7211,7 +7213,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7306,7 +7308,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -7362,6 +7364,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -7386,7 +7389,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -7443,7 +7446,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -7499,7 +7502,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -7591,7 +7594,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -7685,7 +7688,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -7747,7 +7750,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -7800,6 +7803,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -7846,7 +7850,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7934,7 +7938,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -8082,7 +8086,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8138,7 +8142,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -8292,7 +8296,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8372,7 +8376,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9955,6 +9959,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -9979,7 +9984,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -10089,7 +10094,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -10153,7 +10158,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -10208,7 +10213,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -10268,7 +10273,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -10391,7 +10396,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -10510,7 +10515,7 @@ def export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) @@ -10580,7 +10585,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -10669,6 +10674,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -10696,7 +10702,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -10751,7 +10757,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -10816,7 +10822,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -10878,7 +10884,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -10921,7 +10927,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -11008,6 +11014,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -11037,7 +11044,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -11095,7 +11102,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11191,7 +11198,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -11246,7 +11253,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11343,7 +11350,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -11401,7 +11408,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11499,7 +11506,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -11555,7 +11562,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11656,7 +11663,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -11716,7 +11723,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-07-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-07-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py index 99b77616ccd98..3fc5f1b59506c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py index 15e0cf1aa285b..f2973e4764374 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-08-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-08-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py index 1107c12fe8885..1db16ebe8251d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/aio/operations/_operations.py @@ -148,6 +148,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -162,7 +163,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -248,6 +249,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -263,7 +265,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -324,7 +326,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -386,7 +388,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -431,7 +433,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -588,7 +590,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -657,7 +659,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -722,7 +724,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -834,7 +836,7 @@ async def validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -910,7 +912,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -969,7 +971,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1053,7 +1055,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1111,7 +1113,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1170,7 +1172,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1214,7 +1216,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1363,7 +1365,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1429,7 +1431,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1491,7 +1493,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1596,7 +1598,7 @@ async def validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -1669,7 +1671,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -1725,7 +1727,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1808,7 +1810,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -1873,7 +1875,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1939,7 +1941,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -1986,7 +1988,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2149,7 +2151,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2220,7 +2222,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2287,7 +2289,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2408,7 +2410,7 @@ async def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -2486,7 +2488,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -2545,7 +2547,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2631,7 +2633,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -2692,7 +2694,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2753,7 +2755,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -2800,7 +2802,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2950,7 +2952,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3016,7 +3018,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3081,7 +3083,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3188,7 +3190,7 @@ async def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3254,7 +3256,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3404,7 +3406,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3474,7 +3476,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -3531,7 +3533,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3617,7 +3619,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -3683,7 +3685,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3748,7 +3750,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -3796,7 +3798,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3963,7 +3965,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4033,7 +4035,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4102,7 +4104,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4226,7 +4228,7 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4297,7 +4299,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4468,7 +4470,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4542,7 +4544,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -4603,7 +4605,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4698,7 +4700,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -4754,6 +4756,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -4778,7 +4781,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -4835,7 +4838,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -4891,7 +4894,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -4983,7 +4986,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5079,7 +5082,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -5141,7 +5144,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -5194,6 +5197,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -5241,7 +5245,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -5329,7 +5333,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5477,7 +5481,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5533,7 +5537,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -5687,7 +5691,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5768,7 +5772,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7351,6 +7355,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -7375,7 +7380,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -7485,7 +7490,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7549,7 +7554,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -7604,7 +7609,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7664,7 +7669,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -7787,7 +7792,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -7847,7 +7852,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -7992,7 +7997,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -8060,7 +8065,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -8149,6 +8154,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -8176,7 +8182,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -8231,7 +8237,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -8296,7 +8302,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -8358,7 +8364,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -8401,7 +8407,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -8488,6 +8494,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -8517,7 +8524,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -8575,7 +8582,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8671,7 +8678,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -8726,7 +8733,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8823,7 +8830,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -8881,7 +8888,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -8979,7 +8986,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -9035,7 +9042,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -9136,7 +9143,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -9196,7 +9203,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py index 7e7ddf9d62876..939af01fea464 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_08_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -468,7 +468,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -525,7 +525,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -557,7 +557,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -590,7 +590,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -624,7 +624,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -656,7 +656,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -689,7 +689,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -723,7 +723,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -752,7 +752,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -787,7 +787,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -818,7 +818,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -850,7 +850,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -883,7 +883,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -915,7 +915,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -948,7 +948,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -983,7 +983,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1017,7 +1017,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1043,7 +1043,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1082,7 +1082,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1117,7 +1117,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1153,7 +1153,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1190,7 +1190,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1225,7 +1225,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1261,7 +1261,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1299,7 +1299,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1336,7 +1336,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1373,7 +1373,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1428,7 +1428,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1455,7 +1455,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1481,7 +1481,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1537,7 +1537,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1565,7 +1565,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1602,7 +1602,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1645,7 +1645,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1684,7 +1684,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1717,7 +1717,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1766,7 +1766,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1809,7 +1809,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1853,7 +1853,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1899,7 +1899,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1944,7 +1944,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1967,7 +1967,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1990,7 +1990,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2014,7 +2014,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2040,7 +2040,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2065,7 +2065,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2094,7 +2094,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2124,7 +2124,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2153,7 +2153,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2180,7 +2180,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2208,7 +2208,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2242,7 +2242,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2270,7 +2270,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2300,7 +2300,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2328,7 +2328,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2353,7 +2353,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2378,7 +2378,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2402,7 +2402,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2434,7 +2434,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2463,7 +2463,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2496,7 +2496,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2524,7 +2524,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2559,7 +2559,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2591,7 +2591,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2626,7 +2626,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2658,7 +2658,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2696,7 +2696,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2731,7 +2731,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2762,6 +2762,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2776,7 +2777,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2862,6 +2863,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -2877,7 +2879,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -2938,7 +2940,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3000,7 +3002,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3045,7 +3047,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3202,7 +3204,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3271,7 +3273,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3336,7 +3338,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3448,7 +3450,7 @@ def validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -3524,7 +3526,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3583,7 +3585,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3667,7 +3669,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -3725,7 +3727,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3784,7 +3786,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -3828,7 +3830,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3977,7 +3979,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4043,7 +4045,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4105,7 +4107,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4210,7 +4212,7 @@ def validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -4281,7 +4283,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4337,7 +4339,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4420,7 +4422,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -4485,7 +4487,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4549,7 +4551,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -4596,7 +4598,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4759,7 +4761,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4830,7 +4832,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -4897,7 +4899,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5018,7 +5020,7 @@ def validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -5096,7 +5098,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -5155,7 +5157,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5241,7 +5243,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -5302,7 +5304,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5363,7 +5365,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -5410,7 +5412,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5560,7 +5562,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5626,7 +5628,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -5691,7 +5693,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -5798,7 +5800,7 @@ def validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -5864,7 +5866,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6014,7 +6016,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6084,7 +6086,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -6141,7 +6143,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6227,7 +6229,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -6293,7 +6295,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6358,7 +6360,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -6406,7 +6408,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6573,7 +6575,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6643,7 +6645,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -6712,7 +6714,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -6836,7 +6838,7 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) @@ -6907,7 +6909,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -7078,7 +7080,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7152,7 +7154,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -7213,7 +7215,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7308,7 +7310,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -7364,6 +7366,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -7388,7 +7391,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -7445,7 +7448,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -7501,7 +7504,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -7593,7 +7596,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -7687,7 +7690,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -7749,7 +7752,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -7802,6 +7805,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -7849,7 +7853,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -7937,7 +7941,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -8085,7 +8089,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8141,7 +8145,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -8295,7 +8299,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8376,7 +8380,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9959,6 +9963,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -9983,7 +9988,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -10093,7 +10098,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -10157,7 +10162,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -10212,7 +10217,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -10272,7 +10277,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -10395,7 +10400,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -10455,7 +10460,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -10600,7 +10605,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -10668,7 +10673,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -10757,6 +10762,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -10784,7 +10790,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -10839,7 +10845,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -10904,7 +10910,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -10966,7 +10972,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -11009,7 +11015,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -11096,6 +11102,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -11125,7 +11132,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -11183,7 +11190,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11279,7 +11286,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -11334,7 +11341,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11431,7 +11438,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -11489,7 +11496,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11587,7 +11594,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -11643,7 +11650,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -11744,7 +11751,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -11804,7 +11811,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py index c45c6ae3abd61..5a869212b38cc 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-10-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-10-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py index b32b7db6b1058..cb4ac9be1ed93 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-10-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-10-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py index 203dfc1a47d38..aebcdf179cb98 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/aio/operations/_operations.py @@ -154,6 +154,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -168,7 +169,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -254,6 +255,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -269,7 +271,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -330,7 +332,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -392,7 +394,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -437,7 +439,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -594,7 +596,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -663,7 +665,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -728,7 +730,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -772,7 +774,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -926,7 +928,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -997,7 +999,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1056,7 +1058,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1140,7 +1142,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1198,7 +1200,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1257,7 +1259,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1301,7 +1303,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1450,7 +1452,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1516,7 +1518,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1578,7 +1580,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1621,7 +1623,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1768,7 +1770,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1826,7 +1828,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1976,7 +1978,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2046,7 +2048,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2102,7 +2104,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2185,7 +2187,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2250,7 +2252,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2316,7 +2318,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2363,7 +2365,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2526,7 +2528,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2597,7 +2599,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2664,7 +2666,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2710,7 +2712,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2871,7 +2873,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2930,7 +2932,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3094,7 +3096,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3167,7 +3169,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3226,7 +3228,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3312,7 +3314,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3373,7 +3375,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3434,7 +3436,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3481,7 +3483,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3631,7 +3633,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3697,7 +3699,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3762,7 +3764,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3808,7 +3810,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3955,7 +3957,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4013,7 +4015,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4163,7 +4165,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4233,7 +4235,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4290,7 +4292,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4376,7 +4378,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4442,7 +4444,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4507,7 +4509,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4555,7 +4557,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4722,7 +4724,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4792,7 +4794,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4861,7 +4863,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4908,7 +4910,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5072,7 +5074,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5135,7 +5137,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5306,7 +5308,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5380,7 +5382,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5441,7 +5443,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5536,7 +5538,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5592,6 +5594,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5616,7 +5619,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5673,7 +5676,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -5729,7 +5732,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5821,7 +5824,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5917,7 +5920,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -5979,7 +5982,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6032,6 +6035,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6079,7 +6083,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6167,7 +6171,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6315,7 +6319,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6371,7 +6375,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6525,7 +6529,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6606,7 +6610,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8189,6 +8193,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8213,7 +8218,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8323,7 +8328,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8387,7 +8392,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8442,7 +8447,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8502,7 +8507,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8625,7 +8630,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8685,7 +8690,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -8830,7 +8835,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -8898,7 +8903,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -8987,6 +8992,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9018,7 +9024,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9076,7 +9082,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9142,7 +9148,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9206,7 +9212,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9254,7 +9260,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9398,7 +9404,7 @@ async def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9536,7 +9542,7 @@ async def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9605,7 +9611,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -9664,7 +9670,7 @@ async def delete_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -9712,6 +9718,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -9741,7 +9748,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -9799,7 +9806,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -9895,7 +9902,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -9950,7 +9957,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10047,7 +10054,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10105,7 +10112,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10203,7 +10210,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10259,7 +10266,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10360,7 +10367,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10420,7 +10427,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py index cfe6d4c720e19..26b7087afe746 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2019_10_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -469,7 +469,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -497,7 +497,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -554,7 +554,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -586,7 +586,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -619,7 +619,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,7 +653,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -685,7 +685,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -718,7 +718,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -753,7 +753,7 @@ def build_deployments_what_if_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -787,7 +787,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +816,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -851,7 +851,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,7 +882,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -947,7 +947,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -979,7 +979,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1012,7 +1012,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1047,7 +1047,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1107,7 +1107,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1146,7 +1146,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1181,7 +1181,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1254,7 +1254,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1289,7 +1289,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,7 +1325,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1400,7 +1400,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1437,7 +1437,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1492,7 +1492,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1519,7 +1519,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1545,7 +1545,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1601,7 +1601,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1629,7 +1629,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1666,7 +1666,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1709,7 +1709,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1748,7 +1748,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1781,7 +1781,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1830,7 +1830,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1873,7 +1873,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1917,7 +1917,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1963,7 +1963,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2008,7 +2008,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2031,7 +2031,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2054,7 +2054,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2078,7 +2078,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2104,7 +2104,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2129,7 +2129,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2158,7 +2158,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2188,7 +2188,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2217,7 +2217,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2244,7 +2244,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2272,7 +2272,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2306,7 +2306,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2334,7 +2334,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2364,7 +2364,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2392,7 +2392,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2417,7 +2417,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2442,7 +2442,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2466,7 +2466,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2491,7 +2491,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2518,7 +2518,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2544,7 +2544,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2568,7 +2568,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2600,7 +2600,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2629,7 +2629,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2662,7 +2662,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2690,7 +2690,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2725,7 +2725,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2757,7 +2757,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2792,7 +2792,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2824,7 +2824,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2862,7 +2862,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2897,7 +2897,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2928,6 +2928,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2942,7 +2943,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -3028,6 +3029,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -3043,7 +3045,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3104,7 +3106,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3166,7 +3168,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3211,7 +3213,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3368,7 +3370,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3437,7 +3439,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3502,7 +3504,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3546,7 +3548,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3700,7 +3702,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3771,7 +3773,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3830,7 +3832,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3914,7 +3916,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -3972,7 +3974,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4031,7 +4033,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4075,7 +4077,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4224,7 +4226,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4290,7 +4292,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4352,7 +4354,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4395,7 +4397,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4542,7 +4544,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4600,7 +4602,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4750,7 +4752,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4818,7 +4820,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4874,7 +4876,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4957,7 +4959,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -5022,7 +5024,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5086,7 +5088,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5133,7 +5135,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5296,7 +5298,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5367,7 +5369,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5434,7 +5436,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5480,7 +5482,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5641,7 +5643,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5700,7 +5702,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5864,7 +5866,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5937,7 +5939,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -5996,7 +5998,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6082,7 +6084,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6143,7 +6145,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6204,7 +6206,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6251,7 +6253,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6401,7 +6403,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6467,7 +6469,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6532,7 +6534,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6578,7 +6580,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6725,7 +6727,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6783,7 +6785,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6933,7 +6935,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7003,7 +7005,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -7060,7 +7062,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7146,7 +7148,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7212,7 +7214,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7277,7 +7279,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7325,7 +7327,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7492,7 +7494,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7562,7 +7564,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7631,7 +7633,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7678,7 +7680,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7842,7 +7844,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7905,7 +7907,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8076,7 +8078,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8150,7 +8152,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8211,7 +8213,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8306,7 +8308,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8362,6 +8364,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8386,7 +8389,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8443,7 +8446,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -8499,7 +8502,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8591,7 +8594,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8685,7 +8688,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -8747,7 +8750,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -8800,6 +8803,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -8847,7 +8851,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8935,7 +8939,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9083,7 +9087,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9139,7 +9143,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9293,7 +9297,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9374,7 +9378,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -10957,6 +10961,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -10981,7 +10986,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11091,7 +11096,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11155,7 +11160,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11210,7 +11215,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11270,7 +11275,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11393,7 +11398,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11453,7 +11458,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11598,7 +11603,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -11666,7 +11671,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -11755,6 +11760,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -11786,7 +11792,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -11844,7 +11850,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -11910,7 +11916,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -11974,7 +11980,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12022,7 +12028,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12166,7 +12172,7 @@ def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12304,7 +12310,7 @@ def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12373,7 +12379,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12430,7 +12436,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -12478,6 +12484,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -12507,7 +12514,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -12565,7 +12572,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12661,7 +12668,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -12716,7 +12723,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12813,7 +12820,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -12871,7 +12878,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12969,7 +12976,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13025,7 +13032,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13126,7 +13133,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13186,7 +13193,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py index 2682afef9e72b..2d31f8c986994 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_resource_management_client.py @@ -79,14 +79,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-06-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2020-06-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py index 1197b9192f7df..e815cb2a00b01 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/_resource_management_client.py @@ -81,14 +81,22 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-06-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" + ) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2020-06-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-06-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py index d6e299ca5432c..3bdca06c38faf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/aio/operations/_operations.py @@ -155,6 +155,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -169,7 +170,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -255,6 +256,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -270,7 +272,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -331,7 +333,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -393,7 +395,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -438,7 +440,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -595,7 +597,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -664,7 +666,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -729,7 +731,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -773,7 +775,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -927,7 +929,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -998,7 +1000,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1057,7 +1059,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1141,7 +1143,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1199,7 +1201,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1258,7 +1260,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1302,7 +1304,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1451,7 +1453,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1517,7 +1519,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1579,7 +1581,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1622,7 +1624,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1769,7 +1771,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1827,7 +1829,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1977,7 +1979,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2047,7 +2049,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2103,7 +2105,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2186,7 +2188,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2251,7 +2253,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2317,7 +2319,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2364,7 +2366,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2527,7 +2529,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2598,7 +2600,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2665,7 +2667,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2711,7 +2713,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2872,7 +2874,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2931,7 +2933,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3095,7 +3097,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3168,7 +3170,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3227,7 +3229,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3313,7 +3315,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3374,7 +3376,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3435,7 +3437,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3482,7 +3484,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3632,7 +3634,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3698,7 +3700,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3763,7 +3765,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3809,7 +3811,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3956,7 +3958,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4014,7 +4016,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4164,7 +4166,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4234,7 +4236,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4291,7 +4293,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4377,7 +4379,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4443,7 +4445,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4508,7 +4510,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4556,7 +4558,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4723,7 +4725,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4793,7 +4795,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4862,7 +4864,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4909,7 +4911,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5073,7 +5075,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5136,7 +5138,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5307,7 +5309,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5381,7 +5383,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5442,7 +5444,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5537,7 +5539,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5593,6 +5595,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5617,7 +5620,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5678,7 +5681,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -5733,7 +5736,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -5789,7 +5792,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5881,7 +5884,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5977,7 +5980,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -6039,7 +6042,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6092,6 +6095,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6139,7 +6143,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6227,7 +6231,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6375,7 +6379,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6431,7 +6435,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6585,7 +6589,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6666,7 +6670,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8249,6 +8253,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8273,7 +8278,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8383,7 +8388,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8447,7 +8452,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8510,7 +8515,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8571,7 +8576,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8694,7 +8699,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8754,7 +8759,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -8899,7 +8904,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -8967,7 +8972,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -9056,6 +9061,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9087,7 +9093,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9145,7 +9151,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9211,7 +9217,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9275,7 +9281,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9323,7 +9329,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9467,7 +9473,7 @@ async def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9605,7 +9611,7 @@ async def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9674,7 +9680,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -9733,7 +9739,7 @@ async def delete_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -9781,6 +9787,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -9810,7 +9817,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -9868,7 +9875,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -9964,7 +9971,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -10019,7 +10026,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10116,7 +10123,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10174,7 +10181,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10272,7 +10279,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10328,7 +10335,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10429,7 +10436,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10489,7 +10496,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py index 0d257de4dfb7d..55eaac4643015 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_06_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -78,7 +78,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +103,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,7 +129,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -156,7 +156,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,7 +181,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -207,7 +207,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -236,7 +236,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -262,7 +262,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -290,7 +290,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,7 +314,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -339,7 +339,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -365,7 +365,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -389,7 +389,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -414,7 +414,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -441,7 +441,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -467,7 +467,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -522,7 +522,7 @@ def build_deployments_delete_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -552,7 +552,7 @@ def build_deployments_check_existence_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -583,7 +583,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,7 +615,7 @@ def build_deployments_get_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -645,7 +645,7 @@ def build_deployments_cancel_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -676,7 +676,7 @@ def build_deployments_validate_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -709,7 +709,7 @@ def build_deployments_what_if_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -741,7 +741,7 @@ def build_deployments_export_template_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -770,7 +770,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -803,7 +803,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -832,7 +832,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -862,7 +862,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -893,7 +893,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -923,7 +923,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -954,7 +954,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -987,7 +987,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1019,7 +1019,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1045,7 +1045,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1082,7 +1082,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1115,7 +1115,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1149,7 +1149,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1184,7 +1184,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1251,7 +1251,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1287,7 +1287,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1322,7 +1322,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1359,7 +1359,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1414,7 +1414,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1444,7 +1444,7 @@ def build_providers_register_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1471,7 +1471,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1497,7 +1497,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1553,7 +1553,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1581,7 +1581,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1618,7 +1618,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1656,7 +1656,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1690,7 +1690,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1723,7 +1723,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1772,7 +1772,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1815,7 +1815,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1859,7 +1859,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1905,7 +1905,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1950,7 +1950,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1973,7 +1973,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1996,7 +1996,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2020,7 +2020,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2046,7 +2046,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2071,7 +2071,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2100,7 +2100,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2130,7 +2130,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2161,7 +2161,7 @@ def build_resource_groups_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if force_deletion_types is not None: @@ -2190,7 +2190,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2218,7 +2218,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2252,7 +2252,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2280,7 +2280,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2310,7 +2310,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2338,7 +2338,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2363,7 +2363,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2388,7 +2388,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2412,7 +2412,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2437,7 +2437,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2464,7 +2464,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2490,7 +2490,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2514,7 +2514,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2544,7 +2544,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2571,7 +2571,7 @@ def build_deployment_operations_list_at_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2602,7 +2602,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2628,7 +2628,7 @@ def build_deployment_operations_list_at_tenant_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2661,7 +2661,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2691,7 +2691,7 @@ def build_deployment_operations_list_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2724,7 +2724,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2754,7 +2754,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2790,7 +2790,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2823,7 +2823,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2854,6 +2854,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2868,7 +2869,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2954,6 +2955,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -2969,7 +2971,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3030,7 +3032,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3092,7 +3094,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3137,7 +3139,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3294,7 +3296,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3363,7 +3365,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3428,7 +3430,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3472,7 +3474,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3626,7 +3628,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3697,7 +3699,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3756,7 +3758,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3840,7 +3842,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -3898,7 +3900,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3957,7 +3959,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4001,7 +4003,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4150,7 +4152,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4216,7 +4218,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4278,7 +4280,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4321,7 +4323,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4468,7 +4470,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4526,7 +4528,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4676,7 +4678,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4744,7 +4746,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4800,7 +4802,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4883,7 +4885,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -4948,7 +4950,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5012,7 +5014,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5059,7 +5061,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5222,7 +5224,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5293,7 +5295,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5360,7 +5362,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5406,7 +5408,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5567,7 +5569,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5626,7 +5628,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5790,7 +5792,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5863,7 +5865,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -5922,7 +5924,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6008,7 +6010,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6069,7 +6071,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6130,7 +6132,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6177,7 +6179,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6327,7 +6329,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6393,7 +6395,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6458,7 +6460,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6504,7 +6506,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6651,7 +6653,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6709,7 +6711,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6859,7 +6861,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6929,7 +6931,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -6986,7 +6988,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7072,7 +7074,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7138,7 +7140,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7203,7 +7205,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7251,7 +7253,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7418,7 +7420,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7488,7 +7490,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7557,7 +7559,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7604,7 +7606,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7768,7 +7770,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7831,7 +7833,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8002,7 +8004,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8076,7 +8078,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8137,7 +8139,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8232,7 +8234,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8288,6 +8290,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8312,7 +8315,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8373,7 +8376,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -8428,7 +8431,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -8484,7 +8487,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8576,7 +8579,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8670,7 +8673,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -8732,7 +8735,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -8785,6 +8788,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -8832,7 +8836,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8920,7 +8924,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9068,7 +9072,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9124,7 +9128,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9278,7 +9282,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9359,7 +9363,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -10942,6 +10946,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -10966,7 +10971,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11076,7 +11081,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11140,7 +11145,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11203,7 +11208,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11264,7 +11269,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11387,7 +11392,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11447,7 +11452,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11592,7 +11597,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -11660,7 +11665,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -11749,6 +11754,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -11780,7 +11786,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -11838,7 +11844,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -11904,7 +11910,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -11968,7 +11974,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12016,7 +12022,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12160,7 +12166,7 @@ def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12298,7 +12304,7 @@ def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12367,7 +12373,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12424,7 +12430,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -12472,6 +12478,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -12501,7 +12508,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -12559,7 +12566,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12655,7 +12662,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -12710,7 +12717,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12807,7 +12814,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -12865,7 +12872,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12963,7 +12970,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13019,7 +13026,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13120,7 +13127,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13180,7 +13187,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py index 77944677abc66..ad77817f74718 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_resource_management_client.py @@ -83,17 +83,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-10-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2020-10-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py index 841e8a9071fcd..a21f929d7909f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/_resource_management_client.py @@ -85,17 +85,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2020-10-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2020-10-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2020-10-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py index 302c1cfc63d8d..9503c80bfa8e4 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/aio/operations/_operations.py @@ -156,6 +156,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -170,7 +171,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -256,6 +257,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -271,7 +273,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -332,7 +334,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -394,7 +396,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -439,7 +441,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -596,7 +598,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -665,7 +667,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -730,7 +732,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -774,7 +776,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -928,7 +930,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -999,7 +1001,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1058,7 +1060,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1142,7 +1144,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1200,7 +1202,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1259,7 +1261,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1303,7 +1305,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1452,7 +1454,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1518,7 +1520,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1580,7 +1582,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1623,7 +1625,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1770,7 +1772,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1828,7 +1830,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1978,7 +1980,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2048,7 +2050,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2104,7 +2106,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2187,7 +2189,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2252,7 +2254,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2318,7 +2320,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2365,7 +2367,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2528,7 +2530,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2599,7 +2601,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2666,7 +2668,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2712,7 +2714,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2873,7 +2875,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2932,7 +2934,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3096,7 +3098,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3169,7 +3171,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3228,7 +3230,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3314,7 +3316,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3375,7 +3377,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3436,7 +3438,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3483,7 +3485,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3633,7 +3635,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3699,7 +3701,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3764,7 +3766,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3810,7 +3812,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3957,7 +3959,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4015,7 +4017,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4165,7 +4167,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4235,7 +4237,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4292,7 +4294,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4378,7 +4380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4444,7 +4446,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4509,7 +4511,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4557,7 +4559,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4724,7 +4726,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4794,7 +4796,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4863,7 +4865,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4910,7 +4912,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5074,7 +5076,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5137,7 +5139,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5308,7 +5310,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5382,7 +5384,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5443,7 +5445,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5538,7 +5540,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5594,6 +5596,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5618,7 +5621,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5679,7 +5682,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -5734,7 +5737,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -5790,7 +5793,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5882,7 +5885,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5978,7 +5981,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -6040,7 +6043,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6093,6 +6096,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def list( @@ -6121,7 +6125,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -6175,6 +6179,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6222,7 +6227,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6310,7 +6315,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6458,7 +6463,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6514,7 +6519,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6668,7 +6673,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6749,7 +6754,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8332,6 +8337,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8356,7 +8362,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8466,7 +8472,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8530,7 +8536,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8585,7 +8591,7 @@ async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLR _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8645,7 +8651,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8768,7 +8774,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8828,7 +8834,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -8973,7 +8979,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -9041,7 +9047,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -9130,6 +9136,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9161,7 +9168,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9219,7 +9226,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9285,7 +9292,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9349,7 +9356,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9397,7 +9404,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9541,7 +9548,7 @@ async def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9679,7 +9686,7 @@ async def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9748,7 +9755,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -9807,7 +9814,7 @@ async def delete_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -9855,6 +9862,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -9884,7 +9892,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -9942,7 +9950,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10038,7 +10046,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -10093,7 +10101,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10190,7 +10198,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10248,7 +10256,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10346,7 +10354,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10402,7 +10410,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10503,7 +10511,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10563,7 +10571,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py index 8ba627218b2f1..ac7002a330468 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -78,7 +78,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +103,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,7 +129,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -156,7 +156,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,7 +181,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -207,7 +207,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -236,7 +236,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -262,7 +262,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -290,7 +290,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -314,7 +314,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -339,7 +339,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -365,7 +365,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -389,7 +389,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -414,7 +414,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -441,7 +441,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -467,7 +467,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -522,7 +522,7 @@ def build_deployments_delete_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -552,7 +552,7 @@ def build_deployments_check_existence_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -583,7 +583,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -615,7 +615,7 @@ def build_deployments_get_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -645,7 +645,7 @@ def build_deployments_cancel_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -676,7 +676,7 @@ def build_deployments_validate_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -709,7 +709,7 @@ def build_deployments_what_if_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -741,7 +741,7 @@ def build_deployments_export_template_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -770,7 +770,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -803,7 +803,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -832,7 +832,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -862,7 +862,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -893,7 +893,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -923,7 +923,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -954,7 +954,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -987,7 +987,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1019,7 +1019,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1045,7 +1045,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1082,7 +1082,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1115,7 +1115,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1149,7 +1149,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1184,7 +1184,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1251,7 +1251,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1287,7 +1287,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1322,7 +1322,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1359,7 +1359,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1414,7 +1414,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1444,7 +1444,7 @@ def build_providers_register_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1471,7 +1471,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1497,7 +1497,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1553,7 +1553,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1581,7 +1581,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1612,7 +1612,7 @@ def build_provider_resource_types_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1649,7 +1649,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1687,7 +1687,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1721,7 +1721,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1754,7 +1754,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1803,7 +1803,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1846,7 +1846,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1890,7 +1890,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1936,7 +1936,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1981,7 +1981,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2004,7 +2004,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2027,7 +2027,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2051,7 +2051,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2077,7 +2077,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2102,7 +2102,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2131,7 +2131,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2161,7 +2161,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2190,7 +2190,7 @@ def build_resource_groups_delete_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2217,7 +2217,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2245,7 +2245,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2279,7 +2279,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2307,7 +2307,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2337,7 +2337,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2365,7 +2365,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2390,7 +2390,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2415,7 +2415,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2439,7 +2439,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2464,7 +2464,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2491,7 +2491,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2517,7 +2517,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2541,7 +2541,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2571,7 +2571,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2598,7 +2598,7 @@ def build_deployment_operations_list_at_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2629,7 +2629,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2655,7 +2655,7 @@ def build_deployment_operations_list_at_tenant_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2688,7 +2688,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2718,7 +2718,7 @@ def build_deployment_operations_list_at_management_group_scope_request( "deploymentName": _SERIALIZER.url("deployment_name", deployment_name, "str", max_length=64, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2751,7 +2751,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2781,7 +2781,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2817,7 +2817,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2850,7 +2850,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2881,6 +2881,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -2895,7 +2896,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -2981,6 +2982,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -2996,7 +2998,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3057,7 +3059,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3119,7 +3121,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3164,7 +3166,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3321,7 +3323,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3390,7 +3392,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3455,7 +3457,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3499,7 +3501,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3653,7 +3655,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3724,7 +3726,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3783,7 +3785,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3867,7 +3869,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -3925,7 +3927,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3984,7 +3986,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4028,7 +4030,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4177,7 +4179,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4243,7 +4245,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4305,7 +4307,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4348,7 +4350,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4495,7 +4497,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4553,7 +4555,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4703,7 +4705,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4771,7 +4773,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4827,7 +4829,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4910,7 +4912,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -4975,7 +4977,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5039,7 +5041,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5086,7 +5088,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5249,7 +5251,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5320,7 +5322,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5387,7 +5389,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5433,7 +5435,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5594,7 +5596,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5653,7 +5655,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5817,7 +5819,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5890,7 +5892,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -5949,7 +5951,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6035,7 +6037,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6096,7 +6098,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6157,7 +6159,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6204,7 +6206,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6354,7 +6356,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6420,7 +6422,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6485,7 +6487,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6531,7 +6533,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6678,7 +6680,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6736,7 +6738,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6886,7 +6888,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6956,7 +6958,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -7013,7 +7015,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7099,7 +7101,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7165,7 +7167,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7230,7 +7232,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7278,7 +7280,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7445,7 +7447,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7515,7 +7517,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7584,7 +7586,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7631,7 +7633,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7795,7 +7797,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7858,7 +7860,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8029,7 +8031,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8103,7 +8105,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8164,7 +8166,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8259,7 +8261,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8315,6 +8317,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8339,7 +8342,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8400,7 +8403,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -8455,7 +8458,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -8511,7 +8514,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8603,7 +8606,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8697,7 +8700,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -8759,7 +8762,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -8812,6 +8815,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -8840,7 +8844,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -8894,6 +8898,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -8941,7 +8946,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9029,7 +9034,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9177,7 +9182,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9233,7 +9238,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9387,7 +9392,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9468,7 +9473,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -11051,6 +11056,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -11075,7 +11081,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11185,7 +11191,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11249,7 +11255,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11304,7 +11310,7 @@ def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[Non _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11364,7 +11370,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11487,7 +11493,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11547,7 +11553,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11692,7 +11698,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -11760,7 +11766,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -11849,6 +11855,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -11880,7 +11887,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -11938,7 +11945,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -12004,7 +12011,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -12068,7 +12075,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12116,7 +12123,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12260,7 +12267,7 @@ def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12398,7 +12405,7 @@ def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12467,7 +12474,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12524,7 +12531,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -12572,6 +12579,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -12601,7 +12609,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -12659,7 +12667,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12755,7 +12763,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -12810,7 +12818,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12907,7 +12915,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -12965,7 +12973,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13063,7 +13071,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13119,7 +13127,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13220,7 +13228,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13280,7 +13288,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-10-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py index e547319058e64..1951eb6c09e33 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_resource_management_client.py @@ -83,17 +83,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py index e840fc3c8007d..eca9682f4e1fb 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/_resource_management_client.py @@ -85,17 +85,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py index 189819ba33f9d..a2f87acc29990 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/aio/operations/_operations.py @@ -156,6 +156,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -170,7 +171,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -256,6 +257,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -271,7 +273,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -332,7 +334,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -394,7 +396,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -439,7 +441,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -596,7 +598,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -665,7 +667,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -730,7 +732,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -774,7 +776,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -928,7 +930,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -999,7 +1001,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1058,7 +1060,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1142,7 +1144,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1200,7 +1202,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1259,7 +1261,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1303,7 +1305,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1452,7 +1454,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1518,7 +1520,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1580,7 +1582,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1623,7 +1625,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1770,7 +1772,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1828,7 +1830,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1978,7 +1980,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2048,7 +2050,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2104,7 +2106,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2187,7 +2189,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2252,7 +2254,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2318,7 +2320,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2365,7 +2367,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2528,7 +2530,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2599,7 +2601,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2666,7 +2668,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2712,7 +2714,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2873,7 +2875,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2932,7 +2934,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3096,7 +3098,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3169,7 +3171,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3228,7 +3230,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3314,7 +3316,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3375,7 +3377,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3436,7 +3438,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3483,7 +3485,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3633,7 +3635,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3699,7 +3701,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3764,7 +3766,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3810,7 +3812,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3957,7 +3959,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4015,7 +4017,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4165,7 +4167,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4235,7 +4237,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4292,7 +4294,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4378,7 +4380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4444,7 +4446,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4509,7 +4511,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4557,7 +4559,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4724,7 +4726,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4794,7 +4796,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4863,7 +4865,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4910,7 +4912,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5074,7 +5076,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5137,7 +5139,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5308,7 +5310,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5382,7 +5384,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5443,7 +5445,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5538,7 +5540,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5594,6 +5596,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5618,7 +5621,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5679,7 +5682,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -5734,7 +5737,7 @@ async def register(self, resource_provider_namespace: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -5790,7 +5793,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5882,7 +5885,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -5978,7 +5981,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -6040,7 +6043,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6093,6 +6096,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def list( @@ -6121,7 +6125,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -6175,6 +6179,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6222,7 +6227,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6310,7 +6315,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6458,7 +6463,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6514,7 +6519,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6668,7 +6673,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6749,7 +6754,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8332,6 +8337,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8356,7 +8362,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8466,7 +8472,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8530,7 +8536,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8593,7 +8599,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8654,7 +8660,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8777,7 +8783,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8837,7 +8843,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -8982,7 +8988,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -9050,7 +9056,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -9139,6 +9145,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9170,7 +9177,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9228,7 +9235,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9294,7 +9301,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9358,7 +9365,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9406,7 +9413,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9550,7 +9557,7 @@ async def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9688,7 +9695,7 @@ async def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9757,7 +9764,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -9816,7 +9823,7 @@ async def delete_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -9864,6 +9871,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -9893,7 +9901,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -9951,7 +9959,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10047,7 +10055,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -10102,7 +10110,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10199,7 +10207,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10257,7 +10265,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10355,7 +10363,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10411,7 +10419,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10512,7 +10520,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10572,7 +10580,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py index eebe27ef6370d..d7904892b2e7c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -469,7 +469,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -497,7 +497,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -554,7 +554,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -586,7 +586,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -619,7 +619,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,7 +653,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -685,7 +685,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -718,7 +718,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -753,7 +753,7 @@ def build_deployments_what_if_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -787,7 +787,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +816,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -851,7 +851,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,7 +882,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -947,7 +947,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -979,7 +979,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1012,7 +1012,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1047,7 +1047,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1107,7 +1107,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1146,7 +1146,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1181,7 +1181,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1254,7 +1254,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1289,7 +1289,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,7 +1325,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1400,7 +1400,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1437,7 +1437,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1492,7 +1492,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1522,7 +1522,7 @@ def build_providers_register_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1549,7 +1549,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1575,7 +1575,7 @@ def build_providers_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -1631,7 +1631,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1659,7 +1659,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1690,7 +1690,7 @@ def build_provider_resource_types_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1727,7 +1727,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1770,7 +1770,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1809,7 +1809,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1842,7 +1842,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1891,7 +1891,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1934,7 +1934,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1978,7 +1978,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2024,7 +2024,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2069,7 +2069,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2092,7 +2092,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2115,7 +2115,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2139,7 +2139,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2165,7 +2165,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2190,7 +2190,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2219,7 +2219,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2249,7 +2249,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2280,7 +2280,7 @@ def build_resource_groups_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if force_deletion_types is not None: @@ -2309,7 +2309,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2337,7 +2337,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2371,7 +2371,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2399,7 +2399,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2429,7 +2429,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2457,7 +2457,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2482,7 +2482,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2507,7 +2507,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2531,7 +2531,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2556,7 +2556,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2583,7 +2583,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2609,7 +2609,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2633,7 +2633,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2665,7 +2665,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2694,7 +2694,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2727,7 +2727,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2755,7 +2755,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2790,7 +2790,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2822,7 +2822,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2857,7 +2857,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2889,7 +2889,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2927,7 +2927,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2962,7 +2962,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2993,6 +2993,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -3007,7 +3008,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -3093,6 +3094,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -3108,7 +3110,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3169,7 +3171,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3231,7 +3233,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3276,7 +3278,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3433,7 +3435,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3502,7 +3504,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3567,7 +3569,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3611,7 +3613,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3765,7 +3767,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3836,7 +3838,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3895,7 +3897,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3979,7 +3981,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -4037,7 +4039,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4096,7 +4098,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4140,7 +4142,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4289,7 +4291,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4355,7 +4357,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4417,7 +4419,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4460,7 +4462,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4607,7 +4609,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4665,7 +4667,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4815,7 +4817,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4883,7 +4885,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4939,7 +4941,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5022,7 +5024,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -5087,7 +5089,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5151,7 +5153,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5198,7 +5200,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5361,7 +5363,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5432,7 +5434,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5499,7 +5501,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5545,7 +5547,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5706,7 +5708,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5765,7 +5767,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5929,7 +5931,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6002,7 +6004,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -6061,7 +6063,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6147,7 +6149,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6208,7 +6210,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6269,7 +6271,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6316,7 +6318,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6466,7 +6468,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6532,7 +6534,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6597,7 +6599,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6643,7 +6645,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6790,7 +6792,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6848,7 +6850,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -6998,7 +7000,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7068,7 +7070,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -7125,7 +7127,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7211,7 +7213,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7277,7 +7279,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7342,7 +7344,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7390,7 +7392,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7557,7 +7559,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7627,7 +7629,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7696,7 +7698,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7743,7 +7745,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7907,7 +7909,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7970,7 +7972,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8141,7 +8143,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8215,7 +8217,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8276,7 +8278,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8371,7 +8373,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8427,6 +8429,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8451,7 +8454,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8512,7 +8515,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -8567,7 +8570,7 @@ def register(self, resource_provider_namespace: str, **kwargs: Any) -> _models.P _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_register_request( @@ -8623,7 +8626,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8715,7 +8718,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8809,7 +8812,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -8871,7 +8874,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -8924,6 +8927,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -8952,7 +8956,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -9006,6 +9010,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -9053,7 +9058,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9141,7 +9146,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9289,7 +9294,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9345,7 +9350,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9499,7 +9504,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9580,7 +9585,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -11163,6 +11168,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -11187,7 +11193,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11297,7 +11303,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11361,7 +11367,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11424,7 +11430,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11485,7 +11491,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11608,7 +11614,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11668,7 +11674,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11813,7 +11819,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -11881,7 +11887,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -11970,6 +11976,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -12001,7 +12008,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -12059,7 +12066,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -12125,7 +12132,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -12189,7 +12196,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12237,7 +12244,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12381,7 +12388,7 @@ def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12519,7 +12526,7 @@ def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12588,7 +12595,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12645,7 +12652,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -12693,6 +12700,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -12722,7 +12730,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -12780,7 +12788,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -12876,7 +12884,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -12931,7 +12939,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13028,7 +13036,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -13086,7 +13094,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13184,7 +13192,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13240,7 +13248,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13341,7 +13349,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13401,7 +13409,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py index b95e5ec42018e..ee0e59d8b0b28 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_resource_management_client.py @@ -83,17 +83,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-04-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-04-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py index 0639c38a548f8..bb9ee6d156c96 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/_resource_management_client.py @@ -85,17 +85,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2021-04-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-04-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-04-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py index ad2db9dda2841..f51cdffdb92f9 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/aio/operations/_operations.py @@ -157,6 +157,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -171,7 +172,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -257,6 +258,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -272,7 +274,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -333,7 +335,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -395,7 +397,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -440,7 +442,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -597,7 +599,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -666,7 +668,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -731,7 +733,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -775,7 +777,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -929,7 +931,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1000,7 +1002,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1059,7 +1061,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1143,7 +1145,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1201,7 +1203,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1260,7 +1262,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1304,7 +1306,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1453,7 +1455,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1519,7 +1521,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1581,7 +1583,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1624,7 +1626,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1771,7 +1773,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1829,7 +1831,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1979,7 +1981,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2049,7 +2051,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2105,7 +2107,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2188,7 +2190,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2253,7 +2255,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2319,7 +2321,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2366,7 +2368,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2529,7 +2531,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2600,7 +2602,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2667,7 +2669,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2713,7 +2715,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2874,7 +2876,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2933,7 +2935,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3097,7 +3099,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3170,7 +3172,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3229,7 +3231,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3315,7 +3317,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3376,7 +3378,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3437,7 +3439,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3484,7 +3486,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3634,7 +3636,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3700,7 +3702,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3765,7 +3767,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3811,7 +3813,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3958,7 +3960,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4016,7 +4018,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4166,7 +4168,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4236,7 +4238,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4293,7 +4295,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4379,7 +4381,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4445,7 +4447,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4510,7 +4512,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4558,7 +4560,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4725,7 +4727,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4795,7 +4797,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4864,7 +4866,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4911,7 +4913,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5075,7 +5077,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5138,7 +5140,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5309,7 +5311,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5383,7 +5385,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5444,7 +5446,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5539,7 +5541,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5595,6 +5597,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5619,7 +5622,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5683,7 +5686,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -5739,7 +5742,7 @@ async def provider_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None) request = build_providers_provider_permissions_request( @@ -5860,7 +5863,7 @@ async def register( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) @@ -5926,7 +5929,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -6012,7 +6015,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -6107,7 +6110,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -6169,7 +6172,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6222,6 +6225,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def list( @@ -6250,7 +6254,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -6304,6 +6308,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6351,7 +6356,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6439,7 +6444,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6587,7 +6592,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6643,7 +6648,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6797,7 +6802,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6888,7 +6893,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8474,6 +8479,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8498,7 +8504,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8608,7 +8614,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8672,7 +8678,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8735,7 +8741,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8796,7 +8802,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8919,7 +8925,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8979,7 +8985,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -9124,7 +9130,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -9192,7 +9198,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -9281,6 +9287,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9312,7 +9319,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9370,7 +9377,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9436,7 +9443,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9500,7 +9507,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9548,7 +9555,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9692,7 +9699,7 @@ async def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9830,7 +9837,7 @@ async def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -9899,7 +9906,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -9958,7 +9965,7 @@ async def delete_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -10006,6 +10013,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -10035,7 +10043,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -10093,7 +10101,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10189,7 +10197,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -10244,7 +10252,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10341,7 +10349,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10399,7 +10407,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10497,7 +10505,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10553,7 +10561,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10654,7 +10662,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10714,7 +10722,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py index dc284ac66a7f4..3c37c8ed663ab 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_04_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -469,7 +469,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -497,7 +497,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -554,7 +554,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -586,7 +586,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -619,7 +619,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,7 +653,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -685,7 +685,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -718,7 +718,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -753,7 +753,7 @@ def build_deployments_what_if_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -787,7 +787,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +816,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -851,7 +851,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,7 +882,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -947,7 +947,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -979,7 +979,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1012,7 +1012,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1047,7 +1047,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1107,7 +1107,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1146,7 +1146,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1181,7 +1181,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1254,7 +1254,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1289,7 +1289,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,7 +1325,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1400,7 +1400,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1437,7 +1437,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1492,7 +1492,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1522,7 +1522,7 @@ def build_providers_register_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1551,7 +1551,7 @@ def build_providers_provider_permissions_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1579,7 +1579,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1605,7 +1605,7 @@ def build_providers_list_request(subscription_id: str, *, expand: Optional[str] "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1655,7 +1655,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1683,7 +1683,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1714,7 +1714,7 @@ def build_provider_resource_types_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1751,7 +1751,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1794,7 +1794,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1833,7 +1833,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1866,7 +1866,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1915,7 +1915,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1958,7 +1958,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2002,7 +2002,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2048,7 +2048,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2093,7 +2093,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2116,7 +2116,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2139,7 +2139,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2163,7 +2163,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2189,7 +2189,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2214,7 +2214,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2243,7 +2243,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2273,7 +2273,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2304,7 +2304,7 @@ def build_resource_groups_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if force_deletion_types is not None: @@ -2333,7 +2333,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2361,7 +2361,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2395,7 +2395,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2423,7 +2423,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2453,7 +2453,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2481,7 +2481,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2506,7 +2506,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2531,7 +2531,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2555,7 +2555,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2580,7 +2580,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2607,7 +2607,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2633,7 +2633,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2657,7 +2657,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2689,7 +2689,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2718,7 +2718,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2751,7 +2751,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2779,7 +2779,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2814,7 +2814,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2846,7 +2846,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2881,7 +2881,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2913,7 +2913,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2951,7 +2951,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2986,7 +2986,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -3017,6 +3017,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -3031,7 +3032,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -3117,6 +3118,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -3132,7 +3134,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3193,7 +3195,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3255,7 +3257,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3300,7 +3302,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3457,7 +3459,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3526,7 +3528,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3591,7 +3593,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3635,7 +3637,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3789,7 +3791,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3860,7 +3862,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3919,7 +3921,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4003,7 +4005,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -4061,7 +4063,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4120,7 +4122,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4164,7 +4166,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4313,7 +4315,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4379,7 +4381,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4441,7 +4443,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4484,7 +4486,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4631,7 +4633,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4689,7 +4691,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4839,7 +4841,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4907,7 +4909,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4963,7 +4965,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5046,7 +5048,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -5111,7 +5113,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5175,7 +5177,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5222,7 +5224,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5385,7 +5387,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5456,7 +5458,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5523,7 +5525,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5569,7 +5571,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5730,7 +5732,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5789,7 +5791,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5953,7 +5955,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6026,7 +6028,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -6085,7 +6087,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6171,7 +6173,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6232,7 +6234,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6293,7 +6295,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6340,7 +6342,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6490,7 +6492,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6556,7 +6558,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6621,7 +6623,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6667,7 +6669,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6814,7 +6816,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6872,7 +6874,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -7022,7 +7024,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7092,7 +7094,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -7149,7 +7151,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7235,7 +7237,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7301,7 +7303,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7366,7 +7368,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7414,7 +7416,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7581,7 +7583,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7651,7 +7653,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7720,7 +7722,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7767,7 +7769,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7931,7 +7933,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7994,7 +7996,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8165,7 +8167,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8239,7 +8241,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8300,7 +8302,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8395,7 +8397,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8451,6 +8453,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8475,7 +8478,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8539,7 +8542,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -8595,7 +8598,7 @@ def provider_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None) request = build_providers_provider_permissions_request( @@ -8716,7 +8719,7 @@ def register( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) @@ -8782,7 +8785,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8868,7 +8871,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8961,7 +8964,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -9023,7 +9026,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -9076,6 +9079,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -9104,7 +9108,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -9158,6 +9162,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -9205,7 +9210,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9293,7 +9298,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9441,7 +9446,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9497,7 +9502,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9651,7 +9656,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9742,7 +9747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -11328,6 +11333,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -11352,7 +11358,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11462,7 +11468,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11526,7 +11532,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11589,7 +11595,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11650,7 +11656,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11773,7 +11779,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11833,7 +11839,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11978,7 +11984,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -12046,7 +12052,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -12135,6 +12141,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -12166,7 +12173,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -12224,7 +12231,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -12290,7 +12297,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -12354,7 +12361,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12402,7 +12409,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12546,7 +12553,7 @@ def create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12684,7 +12691,7 @@ def update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) @@ -12753,7 +12760,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12810,7 +12817,7 @@ def delete_at_scope(self, scope: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -12858,6 +12865,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -12887,7 +12895,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -12945,7 +12953,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13041,7 +13049,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -13096,7 +13104,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13193,7 +13201,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -13251,7 +13259,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13349,7 +13357,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13405,7 +13413,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13506,7 +13514,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13566,7 +13574,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-04-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py index 78c46093f660c..ac2bd8527b690 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_resource_management_client.py @@ -83,17 +83,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-09-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2022-09-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py index 55b67fa1165db..422912b757c5f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/_resource_management_client.py @@ -85,17 +85,25 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.providers = ProvidersOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-09-01") + self.deployments = DeploymentsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.providers = ProvidersOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) self.provider_resource_types = ProviderResourceTypesOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.resources = ResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" + ) + self.resource_groups = ResourceGroupsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" ) - self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize) + self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize, "2022-09-01") self.deployment_operations = DeploymentOperationsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-09-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py index 8dd5a8f03afb4..4854a9670acb8 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/aio/operations/_operations.py @@ -157,6 +157,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -171,7 +172,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -257,6 +258,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -272,7 +274,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -333,7 +335,7 @@ async def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -395,7 +397,7 @@ async def check_existence_at_scope(self, scope: str, deployment_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -440,7 +442,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -597,7 +599,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -666,7 +668,7 @@ async def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -731,7 +733,7 @@ async def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -775,7 +777,7 @@ async def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -929,7 +931,7 @@ async def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1000,7 +1002,7 @@ async def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -1059,7 +1061,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -1143,7 +1145,7 @@ async def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -1201,7 +1203,7 @@ async def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1260,7 +1262,7 @@ async def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -1304,7 +1306,7 @@ async def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -1453,7 +1455,7 @@ async def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1519,7 +1521,7 @@ async def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -1581,7 +1583,7 @@ async def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -1624,7 +1626,7 @@ async def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -1771,7 +1773,7 @@ async def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1829,7 +1831,7 @@ async def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -1979,7 +1981,7 @@ async def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2049,7 +2051,7 @@ async def export_template_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -2105,7 +2107,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -2188,7 +2190,7 @@ async def _delete_at_management_group_scope_initial( # pylint: disable=inconsis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -2253,7 +2255,7 @@ async def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2319,7 +2321,7 @@ async def check_existence_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -2366,7 +2368,7 @@ async def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -2529,7 +2531,7 @@ async def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2600,7 +2602,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -2667,7 +2669,7 @@ async def cancel_at_management_group_scope( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -2713,7 +2715,7 @@ async def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -2874,7 +2876,7 @@ async def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2933,7 +2935,7 @@ async def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -3097,7 +3099,7 @@ async def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3170,7 +3172,7 @@ async def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -3229,7 +3231,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -3315,7 +3317,7 @@ async def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -3376,7 +3378,7 @@ async def begin_delete_at_subscription_scope(self, deployment_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3437,7 +3439,7 @@ async def check_existence_at_subscription_scope(self, deployment_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -3484,7 +3486,7 @@ async def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3634,7 +3636,7 @@ async def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -3700,7 +3702,7 @@ async def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -3765,7 +3767,7 @@ async def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -3811,7 +3813,7 @@ async def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3958,7 +3960,7 @@ async def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4016,7 +4018,7 @@ async def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4166,7 +4168,7 @@ async def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4236,7 +4238,7 @@ async def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -4293,7 +4295,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4379,7 +4381,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -4445,7 +4447,7 @@ async def begin_delete(self, resource_group_name: str, deployment_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4510,7 +4512,7 @@ async def check_existence(self, resource_group_name: str, deployment_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -4558,7 +4560,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4725,7 +4727,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -4795,7 +4797,7 @@ async def get(self, resource_group_name: str, deployment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -4864,7 +4866,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -4911,7 +4913,7 @@ async def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5075,7 +5077,7 @@ async def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5138,7 +5140,7 @@ async def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5309,7 +5311,7 @@ async def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -5383,7 +5385,7 @@ async def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -5444,7 +5446,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5539,7 +5541,7 @@ async def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _model _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -5595,6 +5597,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -5619,7 +5622,7 @@ async def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -5683,7 +5686,7 @@ async def register_at_management_group_scope( # pylint: disable=inconsistent-re _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -5739,7 +5742,7 @@ async def provider_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None) request = build_providers_provider_permissions_request( @@ -5860,7 +5863,7 @@ async def register( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) @@ -5926,7 +5929,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -6012,7 +6015,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -6107,7 +6110,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -6169,7 +6172,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -6222,6 +6225,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def list( @@ -6250,7 +6254,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -6304,6 +6308,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -6351,7 +6356,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -6439,7 +6444,7 @@ async def _move_resources_initial( # pylint: disable=inconsistent-return-statem _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6587,7 +6592,7 @@ async def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6643,7 +6648,7 @@ async def _validate_move_resources_initial( # pylint: disable=inconsistent-retu _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -6797,7 +6802,7 @@ async def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -6888,7 +6893,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -8474,6 +8479,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -8498,7 +8504,7 @@ async def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -8608,7 +8614,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8672,7 +8678,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -8735,7 +8741,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -8796,7 +8802,7 @@ async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Resource _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -8919,7 +8925,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -8979,7 +8985,7 @@ async def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -9124,7 +9130,7 @@ async def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -9192,7 +9198,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -9281,6 +9287,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def delete_value( # pylint: disable=inconsistent-return-statements @@ -9312,7 +9319,7 @@ async def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -9370,7 +9377,7 @@ async def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -9436,7 +9443,7 @@ async def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDet _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -9500,7 +9507,7 @@ async def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -9548,7 +9555,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -9630,7 +9637,7 @@ async def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.TagsResource]] = kwargs.pop("cls", None) @@ -9776,7 +9783,7 @@ async def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -9832,7 +9839,7 @@ async def _update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.TagsResource]] = kwargs.pop("cls", None) @@ -9995,7 +10002,7 @@ async def begin_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -10061,7 +10068,7 @@ async def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -10108,7 +10115,7 @@ async def _delete_at_scope_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -10164,7 +10171,7 @@ async def begin_delete_at_scope(self, scope: str, **kwargs: Any) -> AsyncLROPoll _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -10215,6 +10222,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace_async async def get_at_scope( @@ -10244,7 +10252,7 @@ async def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -10302,7 +10310,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10398,7 +10406,7 @@ async def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -10453,7 +10461,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10550,7 +10558,7 @@ async def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -10608,7 +10616,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10706,7 +10714,7 @@ async def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -10762,7 +10770,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -10863,7 +10871,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -10923,7 +10931,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py index d4f281d592e8d..606e20f545acf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/__init__.py @@ -22,6 +22,7 @@ from ._models_py3 import DeploymentOperation from ._models_py3 import DeploymentOperationProperties from ._models_py3 import DeploymentOperationsListResult +from ._models_py3 import DeploymentParameter from ._models_py3 import DeploymentProperties from ._models_py3 import DeploymentPropertiesExtended from ._models_py3 import DeploymentValidateResult @@ -39,6 +40,8 @@ from ._models_py3 import HttpMessage from ._models_py3 import Identity from ._models_py3 import IdentityUserAssignedIdentitiesValue +from ._models_py3 import KeyVaultParameterReference +from ._models_py3 import KeyVaultReference from ._models_py3 import OnErrorDeployment from ._models_py3 import OnErrorDeploymentExtended from ._models_py3 import Operation @@ -125,6 +128,7 @@ "DeploymentOperation", "DeploymentOperationProperties", "DeploymentOperationsListResult", + "DeploymentParameter", "DeploymentProperties", "DeploymentPropertiesExtended", "DeploymentValidateResult", @@ -142,6 +146,8 @@ "HttpMessage", "Identity", "IdentityUserAssignedIdentitiesValue", + "KeyVaultParameterReference", + "KeyVaultReference", "OnErrorDeployment", "OnErrorDeploymentExtended", "Operation", diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py index d2a8923cc7162..677543705d90e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/models/_models_py3.py @@ -667,6 +667,40 @@ def __init__(self, *, value: Optional[List["_models.DeploymentOperation"]] = Non self.next_link = None +class DeploymentParameter(_serialization.Model): + """Deployment parameter for the template. + + :ivar value: Input value to the parameter . + :vartype value: any + :ivar reference: Azure Key Vault parameter reference. + :vartype reference: + ~azure.mgmt.resource.resources.v2022_09_01.models.KeyVaultParameterReference + """ + + _attribute_map = { + "value": {"key": "value", "type": "object"}, + "reference": {"key": "reference", "type": "KeyVaultParameterReference"}, + } + + def __init__( + self, + *, + value: Optional[Any] = None, + reference: Optional["_models.KeyVaultParameterReference"] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: Input value to the parameter . + :paramtype value: any + :keyword reference: Azure Key Vault parameter reference. + :paramtype reference: + ~azure.mgmt.resource.resources.v2022_09_01.models.KeyVaultParameterReference + """ + super().__init__(**kwargs) + self.value = value + self.reference = reference + + class DeploymentProperties(_serialization.Model): """Deployment properties. @@ -684,7 +718,8 @@ class DeploymentProperties(_serialization.Model): You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. - :vartype parameters: JSON + :vartype parameters: dict[str, + ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentParameter] :ivar parameters_link: The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. @@ -715,7 +750,7 @@ class DeploymentProperties(_serialization.Model): _attribute_map = { "template": {"key": "template", "type": "object"}, "template_link": {"key": "templateLink", "type": "TemplateLink"}, - "parameters": {"key": "parameters", "type": "object"}, + "parameters": {"key": "parameters", "type": "{DeploymentParameter}"}, "parameters_link": {"key": "parametersLink", "type": "ParametersLink"}, "mode": {"key": "mode", "type": "str"}, "debug_setting": {"key": "debugSetting", "type": "DebugSetting"}, @@ -729,7 +764,7 @@ def __init__( mode: Union[str, "_models.DeploymentMode"], template: Optional[JSON] = None, template_link: Optional["_models.TemplateLink"] = None, - parameters: Optional[JSON] = None, + parameters: Optional[Dict[str, "_models.DeploymentParameter"]] = None, parameters_link: Optional["_models.ParametersLink"] = None, debug_setting: Optional["_models.DebugSetting"] = None, on_error_deployment: Optional["_models.OnErrorDeployment"] = None, @@ -749,7 +784,8 @@ def __init__( template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. - :paramtype parameters: JSON + :paramtype parameters: dict[str, + ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentParameter] :keyword parameters_link: The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. @@ -978,7 +1014,8 @@ class DeploymentWhatIfProperties(DeploymentProperties): You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. - :vartype parameters: JSON + :vartype parameters: dict[str, + ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentParameter] :ivar parameters_link: The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. @@ -1012,7 +1049,7 @@ class DeploymentWhatIfProperties(DeploymentProperties): _attribute_map = { "template": {"key": "template", "type": "object"}, "template_link": {"key": "templateLink", "type": "TemplateLink"}, - "parameters": {"key": "parameters", "type": "object"}, + "parameters": {"key": "parameters", "type": "{DeploymentParameter}"}, "parameters_link": {"key": "parametersLink", "type": "ParametersLink"}, "mode": {"key": "mode", "type": "str"}, "debug_setting": {"key": "debugSetting", "type": "DebugSetting"}, @@ -1027,7 +1064,7 @@ def __init__( mode: Union[str, "_models.DeploymentMode"], template: Optional[JSON] = None, template_link: Optional["_models.TemplateLink"] = None, - parameters: Optional[JSON] = None, + parameters: Optional[Dict[str, "_models.DeploymentParameter"]] = None, parameters_link: Optional["_models.ParametersLink"] = None, debug_setting: Optional["_models.DebugSetting"] = None, on_error_deployment: Optional["_models.OnErrorDeployment"] = None, @@ -1048,7 +1085,8 @@ def __init__( template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. - :paramtype parameters: JSON + :paramtype parameters: dict[str, + ~azure.mgmt.resource.resources.v2022_09_01.models.DeploymentParameter] :keyword parameters_link: The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. @@ -1697,6 +1735,78 @@ def __init__(self, **kwargs: Any) -> None: self.client_id = None +class KeyVaultParameterReference(_serialization.Model): + """Azure Key Vault parameter reference. + + All required parameters must be populated in order to send to Azure. + + :ivar key_vault: Azure Key Vault reference. Required. + :vartype key_vault: ~azure.mgmt.resource.resources.v2022_09_01.models.KeyVaultReference + :ivar secret_name: Azure Key Vault secret name. Required. + :vartype secret_name: str + :ivar secret_version: Azure Key Vault secret version. + :vartype secret_version: str + """ + + _validation = { + "key_vault": {"required": True}, + "secret_name": {"required": True}, + } + + _attribute_map = { + "key_vault": {"key": "keyVault", "type": "KeyVaultReference"}, + "secret_name": {"key": "secretName", "type": "str"}, + "secret_version": {"key": "secretVersion", "type": "str"}, + } + + def __init__( + self, + *, + key_vault: "_models.KeyVaultReference", + secret_name: str, + secret_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_vault: Azure Key Vault reference. Required. + :paramtype key_vault: ~azure.mgmt.resource.resources.v2022_09_01.models.KeyVaultReference + :keyword secret_name: Azure Key Vault secret name. Required. + :paramtype secret_name: str + :keyword secret_version: Azure Key Vault secret version. + :paramtype secret_version: str + """ + super().__init__(**kwargs) + self.key_vault = key_vault + self.secret_name = secret_name + self.secret_version = secret_version + + +class KeyVaultReference(_serialization.Model): + """Azure Key Vault reference. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure Key Vault resource id. Required. + :vartype id: str + """ + + _validation = { + "id": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Azure Key Vault resource id. Required. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + class OnErrorDeployment(_serialization.Model): """Deployment on error behavior. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py index 9d2994b135d33..5a6e881277c5a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py @@ -31,7 +31,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping @@ -80,7 +80,7 @@ def build_deployments_delete_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_deployments_check_existence_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +135,7 @@ def build_deployments_create_or_update_at_scope_request(scope: str, deployment_n ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,7 +164,7 @@ def build_deployments_get_at_scope_request(scope: str, deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,7 +191,7 @@ def build_deployments_cancel_at_scope_request(scope: str, deployment_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,7 +219,7 @@ def build_deployments_validate_at_scope_request(scope: str, deployment_name: str ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,7 +250,7 @@ def build_deployments_export_template_at_scope_request(scope: str, deployment_na ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -276,7 +276,7 @@ def build_deployments_list_at_scope_request( "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -306,7 +306,7 @@ def build_deployments_delete_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -332,7 +332,7 @@ def build_deployments_check_existence_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,7 +359,7 @@ def build_deployments_create_or_update_at_tenant_scope_request(deployment_name: ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,7 +387,7 @@ def build_deployments_get_at_tenant_scope_request(deployment_name: str, **kwargs ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_deployments_cancel_at_tenant_scope_request(deployment_name: str, **kwa ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -440,7 +440,7 @@ def build_deployments_validate_at_tenant_scope_request(deployment_name: str, **k ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -469,7 +469,7 @@ def build_deployments_what_if_at_tenant_scope_request(deployment_name: str, **kw ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -497,7 +497,7 @@ def build_deployments_export_template_at_tenant_scope_request(deployment_name: s ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -554,7 +554,7 @@ def build_deployments_delete_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -586,7 +586,7 @@ def build_deployments_check_existence_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -619,7 +619,7 @@ def build_deployments_create_or_update_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -653,7 +653,7 @@ def build_deployments_get_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -685,7 +685,7 @@ def build_deployments_cancel_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -718,7 +718,7 @@ def build_deployments_validate_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -753,7 +753,7 @@ def build_deployments_what_if_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -787,7 +787,7 @@ def build_deployments_export_template_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -816,7 +816,7 @@ def build_deployments_list_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -851,7 +851,7 @@ def build_deployments_delete_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -882,7 +882,7 @@ def build_deployments_check_existence_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -914,7 +914,7 @@ def build_deployments_create_or_update_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -947,7 +947,7 @@ def build_deployments_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -979,7 +979,7 @@ def build_deployments_cancel_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1012,7 +1012,7 @@ def build_deployments_validate_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1047,7 +1047,7 @@ def build_deployments_what_if_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1081,7 +1081,7 @@ def build_deployments_export_template_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1107,7 +1107,7 @@ def build_deployments_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1146,7 +1146,7 @@ def build_deployments_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1181,7 +1181,7 @@ def build_deployments_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1217,7 +1217,7 @@ def build_deployments_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1254,7 +1254,7 @@ def build_deployments_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1289,7 +1289,7 @@ def build_deployments_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1325,7 +1325,7 @@ def build_deployments_validate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1363,7 +1363,7 @@ def build_deployments_what_if_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1400,7 +1400,7 @@ def build_deployments_export_template_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1437,7 +1437,7 @@ def build_deployments_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1492,7 +1492,7 @@ def build_providers_unregister_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1522,7 +1522,7 @@ def build_providers_register_at_management_group_scope_request( "groupId": _SERIALIZER.url("group_id", group_id, "str", max_length=90, min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1551,7 +1551,7 @@ def build_providers_provider_permissions_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1579,7 +1579,7 @@ def build_providers_register_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1605,7 +1605,7 @@ def build_providers_list_request(subscription_id: str, *, expand: Optional[str] "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1655,7 +1655,7 @@ def build_providers_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1683,7 +1683,7 @@ def build_providers_get_at_tenant_scope_request( "resourceProviderNamespace": _SERIALIZER.url("resource_provider_namespace", resource_provider_namespace, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1714,7 +1714,7 @@ def build_provider_resource_types_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -1751,7 +1751,7 @@ def build_resources_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1794,7 +1794,7 @@ def build_resources_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1833,7 +1833,7 @@ def build_resources_validate_move_resources_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1866,7 +1866,7 @@ def build_resources_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -1915,7 +1915,7 @@ def build_resources_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -1958,7 +1958,7 @@ def build_resources_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2002,7 +2002,7 @@ def build_resources_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2048,7 +2048,7 @@ def build_resources_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2093,7 +2093,7 @@ def build_resources_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2116,7 +2116,7 @@ def build_resources_check_existence_by_id_request(resource_id: str, *, api_versi "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2139,7 +2139,7 @@ def build_resources_delete_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2163,7 +2163,7 @@ def build_resources_create_or_update_by_id_request(resource_id: str, *, api_vers "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2189,7 +2189,7 @@ def build_resources_update_by_id_request(resource_id: str, *, api_version: str, "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2214,7 +2214,7 @@ def build_resources_get_by_id_request(resource_id: str, *, api_version: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2243,7 +2243,7 @@ def build_resource_groups_check_existence_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2273,7 +2273,7 @@ def build_resource_groups_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2304,7 +2304,7 @@ def build_resource_groups_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if force_deletion_types is not None: @@ -2333,7 +2333,7 @@ def build_resource_groups_get_request(resource_group_name: str, subscription_id: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2361,7 +2361,7 @@ def build_resource_groups_update_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2395,7 +2395,7 @@ def build_resource_groups_export_template_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2423,7 +2423,7 @@ def build_resource_groups_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -2453,7 +2453,7 @@ def build_tags_delete_value_request(tag_name: str, tag_value: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2481,7 +2481,7 @@ def build_tags_create_or_update_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2506,7 +2506,7 @@ def build_tags_create_or_update_request(tag_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2531,7 +2531,7 @@ def build_tags_delete_request(tag_name: str, subscription_id: str, **kwargs: Any "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2555,7 +2555,7 @@ def build_tags_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2580,7 +2580,7 @@ def build_tags_create_or_update_at_scope_request(scope: str, **kwargs: Any) -> H "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2607,7 +2607,7 @@ def build_tags_update_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2633,7 +2633,7 @@ def build_tags_get_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2657,7 +2657,7 @@ def build_tags_delete_at_scope_request(scope: str, **kwargs: Any) -> HttpRequest "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2689,7 +2689,7 @@ def build_deployment_operations_get_at_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2718,7 +2718,7 @@ def build_deployment_operations_list_at_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2751,7 +2751,7 @@ def build_deployment_operations_get_at_tenant_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2779,7 +2779,7 @@ def build_deployment_operations_list_at_tenant_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2814,7 +2814,7 @@ def build_deployment_operations_get_at_management_group_scope_request( "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2846,7 +2846,7 @@ def build_deployment_operations_list_at_management_group_scope_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2881,7 +2881,7 @@ def build_deployment_operations_get_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2913,7 +2913,7 @@ def build_deployment_operations_list_at_subscription_scope_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -2951,7 +2951,7 @@ def build_deployment_operations_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -2986,7 +2986,7 @@ def build_deployment_operations_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if top is not None: @@ -3017,6 +3017,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -3031,7 +3032,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -3117,6 +3118,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements self, scope: str, deployment_name: str, **kwargs: Any @@ -3132,7 +3134,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_scope_request( @@ -3193,7 +3195,7 @@ def begin_delete_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3255,7 +3257,7 @@ def check_existence_at_scope(self, scope: str, deployment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_scope_request( @@ -3300,7 +3302,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -3457,7 +3459,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3526,7 +3528,7 @@ def get_at_scope(self, scope: str, deployment_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_scope_request( @@ -3591,7 +3593,7 @@ def cancel_at_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_scope_request( @@ -3635,7 +3637,7 @@ def _validate_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -3789,7 +3791,7 @@ def begin_validate_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3860,7 +3862,7 @@ def export_template_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_scope_request( @@ -3919,7 +3921,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -4003,7 +4005,7 @@ def _delete_at_tenant_scope_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_tenant_scope_request( @@ -4061,7 +4063,7 @@ def begin_delete_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> L _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4120,7 +4122,7 @@ def check_existence_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_tenant_scope_request( @@ -4164,7 +4166,7 @@ def _create_or_update_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -4313,7 +4315,7 @@ def begin_create_or_update_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4379,7 +4381,7 @@ def get_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> _models.De _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_tenant_scope_request( @@ -4441,7 +4443,7 @@ def cancel_at_tenant_scope( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_tenant_scope_request( @@ -4484,7 +4486,7 @@ def _validate_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -4631,7 +4633,7 @@ def begin_validate_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4689,7 +4691,7 @@ def _what_if_at_tenant_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -4839,7 +4841,7 @@ def begin_what_if_at_tenant_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -4907,7 +4909,7 @@ def export_template_at_tenant_scope(self, deployment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_tenant_scope_request( @@ -4963,7 +4965,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -5046,7 +5048,7 @@ def _delete_at_management_group_scope_initial( # pylint: disable=inconsistent-r _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_management_group_scope_request( @@ -5111,7 +5113,7 @@ def begin_delete_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -5175,7 +5177,7 @@ def check_existence_at_management_group_scope(self, group_id: str, deployment_na _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_management_group_scope_request( @@ -5222,7 +5224,7 @@ def _create_or_update_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -5385,7 +5387,7 @@ def begin_create_or_update_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5456,7 +5458,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_management_group_scope_request( @@ -5523,7 +5525,7 @@ def cancel_at_management_group_scope( # pylint: disable=inconsistent-return-sta _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_management_group_scope_request( @@ -5569,7 +5571,7 @@ def _validate_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -5730,7 +5732,7 @@ def begin_validate_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -5789,7 +5791,7 @@ def _what_if_at_management_group_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -5953,7 +5955,7 @@ def begin_what_if_at_management_group_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6026,7 +6028,7 @@ def export_template_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_management_group_scope_request( @@ -6085,7 +6087,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -6171,7 +6173,7 @@ def _delete_at_subscription_scope_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_at_subscription_scope_request( @@ -6232,7 +6234,7 @@ def begin_delete_at_subscription_scope(self, deployment_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -6293,7 +6295,7 @@ def check_existence_at_subscription_scope(self, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_at_subscription_scope_request( @@ -6340,7 +6342,7 @@ def _create_or_update_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -6490,7 +6492,7 @@ def begin_create_or_update_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6556,7 +6558,7 @@ def get_at_subscription_scope(self, deployment_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_at_subscription_scope_request( @@ -6621,7 +6623,7 @@ def cancel_at_subscription_scope( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_at_subscription_scope_request( @@ -6667,7 +6669,7 @@ def _validate_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -6814,7 +6816,7 @@ def begin_validate_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -6872,7 +6874,7 @@ def _what_if_at_subscription_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -7022,7 +7024,7 @@ def begin_what_if_at_subscription_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7092,7 +7094,7 @@ def export_template_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_at_subscription_scope_request( @@ -7149,7 +7151,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -7235,7 +7237,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_delete_request( @@ -7301,7 +7303,7 @@ def begin_delete(self, resource_group_name: str, deployment_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -7366,7 +7368,7 @@ def check_existence(self, resource_group_name: str, deployment_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_check_existence_request( @@ -7414,7 +7416,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) @@ -7581,7 +7583,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7651,7 +7653,7 @@ def get(self, resource_group_name: str, deployment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExtended] = kwargs.pop("cls", None) request = build_deployments_get_request( @@ -7720,7 +7722,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_deployments_cancel_request( @@ -7767,7 +7769,7 @@ def _validate_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DeploymentValidateResult]] = kwargs.pop("cls", None) @@ -7931,7 +7933,7 @@ def begin_validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DeploymentValidateResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -7994,7 +7996,7 @@ def _what_if_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WhatIfOperationResult]] = kwargs.pop("cls", None) @@ -8165,7 +8167,7 @@ def begin_what_if( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WhatIfOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -8239,7 +8241,7 @@ def export_template( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentExportResult] = kwargs.pop("cls", None) request = build_deployments_export_template_request( @@ -8300,7 +8302,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentListResult] = kwargs.pop("cls", None) error_map = { @@ -8395,7 +8397,7 @@ def calculate_template_hash(self, template: JSON, **kwargs: Any) -> _models.Temp _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[_models.TemplateHashResult] = kwargs.pop("cls", None) @@ -8451,6 +8453,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models.Provider: @@ -8475,7 +8478,7 @@ def unregister(self, resource_provider_namespace: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_unregister_request( @@ -8539,7 +8542,7 @@ def register_at_management_group_scope( # pylint: disable=inconsistent-return-s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_providers_register_at_management_group_scope_request( @@ -8595,7 +8598,7 @@ def provider_permissions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderPermissionListResult] = kwargs.pop("cls", None) request = build_providers_provider_permissions_request( @@ -8716,7 +8719,7 @@ def register( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) @@ -8782,7 +8785,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8868,7 +8871,7 @@ def list_at_tenant_scope(self, expand: Optional[str] = None, **kwargs: Any) -> I _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderListResult] = kwargs.pop("cls", None) error_map = { @@ -8961,7 +8964,7 @@ def get(self, resource_provider_namespace: str, expand: Optional[str] = None, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_request( @@ -9023,7 +9026,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.Provider] = kwargs.pop("cls", None) request = build_providers_get_at_tenant_scope_request( @@ -9076,6 +9079,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list( @@ -9104,7 +9108,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ProviderResourceTypeListResult] = kwargs.pop("cls", None) request = build_provider_resource_types_list_request( @@ -9158,6 +9162,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_by_resource_group( @@ -9205,7 +9210,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -9293,7 +9298,7 @@ def _move_resources_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9441,7 +9446,7 @@ def begin_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9497,7 +9502,7 @@ def _validate_move_resources_initial( # pylint: disable=inconsistent-return-sta _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -9651,7 +9656,7 @@ def begin_validate_move_resources( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -9742,7 +9747,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -11328,6 +11333,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: @@ -11352,7 +11358,7 @@ def check_existence(self, resource_group_name: str, **kwargs: Any) -> bool: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_check_existence_request( @@ -11462,7 +11468,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11526,7 +11532,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resource_groups_delete_request( @@ -11589,7 +11595,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -11650,7 +11656,7 @@ def get(self, resource_group_name: str, **kwargs: Any) -> _models.ResourceGroup: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) request = build_resource_groups_get_request( @@ -11773,7 +11779,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroup] = kwargs.pop("cls", None) @@ -11833,7 +11839,7 @@ def _export_template_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ResourceGroupExportResult]] = kwargs.pop("cls", None) @@ -11978,7 +11984,7 @@ def begin_export_template( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ResourceGroupExportResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -12046,7 +12052,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ResourceGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -12135,6 +12141,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def delete_value( # pylint: disable=inconsistent-return-statements @@ -12166,7 +12173,7 @@ def delete_value( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_value_request( @@ -12224,7 +12231,7 @@ def create_or_update_value(self, tag_name: str, tag_value: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagValue] = kwargs.pop("cls", None) request = build_tags_create_or_update_value_request( @@ -12290,7 +12297,7 @@ def create_or_update(self, tag_name: str, **kwargs: Any) -> _models.TagDetails: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagDetails] = kwargs.pop("cls", None) request = build_tags_create_or_update_request( @@ -12354,7 +12361,7 @@ def delete(self, tag_name: str, **kwargs: Any) -> None: # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_request( @@ -12402,7 +12409,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TagDetails"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagsListResult] = kwargs.pop("cls", None) error_map = { @@ -12484,7 +12491,7 @@ def _create_or_update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.TagsResource]] = kwargs.pop("cls", None) @@ -12630,7 +12637,7 @@ def begin_create_or_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -12686,7 +12693,7 @@ def _update_at_scope_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.TagsResource]] = kwargs.pop("cls", None) @@ -12849,7 +12856,7 @@ def begin_update_at_scope( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -12915,7 +12922,7 @@ def get_at_scope(self, scope: str, **kwargs: Any) -> _models.TagsResource: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.TagsResource] = kwargs.pop("cls", None) request = build_tags_get_at_scope_request( @@ -12962,7 +12969,7 @@ def _delete_at_scope_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_tags_delete_at_scope_request( @@ -13018,7 +13025,7 @@ def begin_delete_at_scope(self, scope: str, **kwargs: Any) -> LROPoller[None]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -13069,6 +13076,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def get_at_scope( @@ -13098,7 +13106,7 @@ def get_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_scope_request( @@ -13156,7 +13164,7 @@ def list_at_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13252,7 +13260,7 @@ def get_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_tenant_scope_request( @@ -13307,7 +13315,7 @@ def list_at_tenant_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13404,7 +13412,7 @@ def get_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_management_group_scope_request( @@ -13462,7 +13470,7 @@ def list_at_management_group_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13560,7 +13568,7 @@ def get_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_at_subscription_scope_request( @@ -13616,7 +13624,7 @@ def list_at_subscription_scope( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { @@ -13717,7 +13725,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperation] = kwargs.pop("cls", None) request = build_deployment_operations_get_request( @@ -13777,7 +13785,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.DeploymentOperationsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py index f860cc2a13ebe..010055886b7e7 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/_subscription_client.py @@ -68,6 +68,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = SubscriptionClientConfiguration(credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(SubscriptionClient, self).__init__( @@ -134,7 +136,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def subscriptions(self): @@ -163,7 +165,7 @@ def subscriptions(self): else: raise ValueError("API version {} does not have operation group 'subscriptions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def tenants(self): @@ -192,7 +194,7 @@ def tenants(self): else: raise ValueError("API version {} does not have operation group 'tenants'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/aio/_subscription_client.py index e03a8d28b7abd..8539308219d7b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/aio/_subscription_client.py @@ -68,6 +68,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = SubscriptionClientConfiguration(credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(SubscriptionClient, self).__init__( @@ -134,7 +136,7 @@ def operations(self): else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def subscriptions(self): @@ -163,7 +165,7 @@ def subscriptions(self): else: raise ValueError("API version {} does not have operation group 'subscriptions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def tenants(self): @@ -192,7 +194,7 @@ def tenants(self): else: raise ValueError("API version {} does not have operation group 'tenants'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py index c801963eea2cd..a0997b09a13b2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_subscription_client.py @@ -53,9 +53,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2016-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py index 593a8d6aacc5b..75822df3af05c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/_subscription_client.py @@ -54,9 +54,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2016-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2016-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2016-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py index 631454b85bafb..a0bc3da0ba7e5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -76,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -162,6 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["_models.Location"]: @@ -181,7 +183,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -271,7 +273,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -317,7 +319,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -458,7 +460,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -523,6 +525,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -537,7 +540,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -606,6 +609,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -685,7 +694,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2016-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py index 85636007ede85..b21e7a30be4cb 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2016_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +69,7 @@ def build_subscriptions_list_locations_request(subscription_id: str, **kwargs: A "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +93,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,6 +209,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -223,7 +224,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -309,6 +310,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_models.Location"]: @@ -328,7 +330,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -418,7 +420,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -464,7 +466,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -605,7 +607,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -670,6 +672,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -684,7 +687,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2016-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -753,6 +756,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -832,7 +841,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2016-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2016-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py index 9a3f87b61745b..10e04269ab245 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_subscription_client.py @@ -53,9 +53,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2018-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py index 2212652220247..bd962d3ae58d0 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/_subscription_client.py @@ -54,9 +54,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2018-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2018-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2018-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py index 235d29ce994a8..5ae1a291ee8ca 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -76,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -162,6 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["_models.Location"]: @@ -181,7 +183,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -271,7 +273,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -317,7 +319,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -458,7 +460,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -523,6 +525,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -537,7 +540,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -606,6 +609,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -685,7 +694,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2018-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py index 00aa1683a5144..bbcab2b597597 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2018_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +69,7 @@ def build_subscriptions_list_locations_request(subscription_id: str, **kwargs: A "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +93,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,6 +209,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -223,7 +224,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -309,6 +310,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_models.Location"]: @@ -328,7 +330,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -418,7 +420,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -464,7 +466,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -605,7 +607,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -670,6 +672,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -684,7 +687,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -753,6 +756,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -832,7 +841,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2018-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py index 26288d36e0693..0e654d8445fc2 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_subscription_client.py @@ -53,9 +53,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py index e47fcabe73e1b..337074c54561a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/_subscription_client.py @@ -54,9 +54,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-06-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-06-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-06-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py index c6d8fbcc3f531..49f83a2034697 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -76,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -162,6 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["_models.Location"]: @@ -181,7 +183,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -271,7 +273,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -317,7 +319,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -458,7 +460,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -523,6 +525,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -537,7 +540,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -606,6 +609,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -685,7 +694,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2019-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py index 2899090c8d28c..b20049bd48261 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_06_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +69,7 @@ def build_subscriptions_list_locations_request(subscription_id: str, **kwargs: A "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +93,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,6 +209,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -223,7 +224,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -309,6 +310,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_models.Location"]: @@ -328,7 +330,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -418,7 +420,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -464,7 +466,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -605,7 +607,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -670,6 +672,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -684,7 +687,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -753,6 +756,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -832,7 +841,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2019-06-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py index e426556c854c6..2a936e199df3d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_subscription_client.py @@ -53,9 +53,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-11-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-11-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-11-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py index ff1bfec4d9a4a..a7f08c96a0b8f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/_subscription_client.py @@ -54,9 +54,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2019-11-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-11-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2019-11-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py index c309084cb08e2..b7182b9db71bd 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -76,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -162,6 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable["_models.Location"]: @@ -181,7 +183,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -271,7 +273,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -317,7 +319,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -458,7 +460,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -523,6 +525,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -537,7 +540,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -606,6 +609,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -685,7 +694,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2019-11-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py index b5ae628263a57..2361116d93269 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +69,7 @@ def build_subscriptions_list_locations_request(subscription_id: str, **kwargs: A "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +93,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,6 +209,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -223,7 +224,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -309,6 +310,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_models.Location"]: @@ -328,7 +330,7 @@ def list_locations(self, subscription_id: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -418,7 +420,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -464,7 +466,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -605,7 +607,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -670,6 +672,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -684,7 +687,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -753,6 +756,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -832,7 +841,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2019-11-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py index 7f9f4dbda72a9..4aa540ba7506e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_subscription_client.py @@ -51,8 +51,10 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py index 4fa48232c2707..90779c900b4ce 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/_subscription_client.py @@ -52,8 +52,10 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-01-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2021-01-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py index 2c788c20e3484..27e4bba8a2f20 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/aio/operations/_operations.py @@ -61,6 +61,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations( @@ -85,7 +86,7 @@ def list_locations( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -176,7 +177,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -222,7 +223,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -363,7 +364,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -428,6 +429,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -442,7 +444,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -511,6 +513,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -590,7 +598,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2021-01-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py index 2667b6e939dc7..8fb77543ce949 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2021_01_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +52,7 @@ def build_subscriptions_list_locations_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +80,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,7 +124,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,6 +196,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations( @@ -220,7 +221,7 @@ def list_locations( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -311,7 +312,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -357,7 +358,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -498,7 +499,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -563,6 +564,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -577,7 +579,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-01-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -646,6 +648,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -725,7 +733,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2021-01-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py index f016ab506d2d0..e7ac816e3f85a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_subscription_client.py @@ -53,9 +53,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-12-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-12-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2022-12-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py index 5c8832ef4c92d..9fa50cf60740a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_vendor.py @@ -6,7 +6,7 @@ # -------------------------------------------------------------------------- from abc import ABC -from typing import List, TYPE_CHECKING, cast +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest @@ -27,18 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) - - class SubscriptionClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py index 1f5017cc50556..39a500fab0f08 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/_subscription_client.py @@ -54,9 +54,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.subscriptions = SubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2022-12-01") + self.subscriptions = SubscriptionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-12-01" + ) + self.tenants = TenantsOperations(self._client, self._config, self._serialize, self._deserialize, "2022-12-01") def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py index 5d1b5d4c43e39..0d53f6d1862d5 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/aio/operations/_operations.py @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: @@ -76,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -162,6 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations( @@ -186,7 +188,7 @@ def list_locations( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -277,7 +279,7 @@ async def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -323,7 +325,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -464,7 +466,7 @@ async def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -529,6 +531,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: @@ -543,7 +546,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -612,6 +615,12 @@ async def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload async def check_resource_name( self, @@ -691,7 +700,9 @@ async def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2022-12-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py index 67b174c0880f3..6b17a647c7174 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import SubscriptionClientMixinABC, _convert_request, _format_url_section +from .._vendor import SubscriptionClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -71,7 +71,7 @@ def build_subscriptions_list_locations_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -99,7 +99,7 @@ def build_subscriptions_get_request(subscription_id: str, **kwargs: Any) -> Http "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,7 +143,7 @@ def build_subscriptions_check_zone_peers_request(subscription_id: str, **kwargs: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -215,6 +215,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: @@ -229,7 +230,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -315,6 +316,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list_locations( @@ -339,7 +341,7 @@ def list_locations( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.LocationListResult] = kwargs.pop("cls", None) error_map = { @@ -430,7 +432,7 @@ def get(self, subscription_id: str, **kwargs: Any) -> _models.Subscription: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.Subscription] = kwargs.pop("cls", None) request = build_subscriptions_get_request( @@ -476,7 +478,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Subscription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.SubscriptionListResult] = kwargs.pop("cls", None) error_map = { @@ -617,7 +619,7 @@ def check_zone_peers( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckZonePeersResult] = kwargs.pop("cls", None) @@ -682,6 +684,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: @@ -696,7 +699,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.TenantIdDescription"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-12-01")) cls: ClsType[_models.TenantListResult] = kwargs.pop("cls", None) error_map = { @@ -765,6 +768,12 @@ def get_next(next_link=None): class SubscriptionClientOperationsMixin(SubscriptionClientMixinABC): + def _api_version(self, op_name: str) -> str: # pylint: disable=unused-argument + try: + return self._config.api_version + except: # pylint: disable=bare-except + return "" + @overload def check_resource_name( self, @@ -844,7 +853,9 @@ def check_resource_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version("check_resource_name") or "2022-12-01") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckResourceNameResult] = kwargs.pop("cls", None) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py index e3cc6ce6ed6f8..a00658b1fc190 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_serialization.py @@ -664,8 +664,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -743,6 +744,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -751,10 +754,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get('skip_quote', False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -893,6 +894,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -905,9 +908,18 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get('do_quote', False): + serialized = [ + '' if s is None else quote(str(s), safe='') + for s + in serialized + ] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -952,7 +964,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py index 6f1c75437aa4e..5e0b8da2a0239 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/_template_specs_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles=KnownProfiles.default, **kwargs: Any ): + if api_version: + kwargs.setdefault('api_version', api_version) self._config = TemplateSpecsClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(TemplateSpecsClient, self).__init__( @@ -125,7 +127,7 @@ def template_spec_versions(self): else: raise ValueError("API version {} does not have operation group 'template_spec_versions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def template_specs(self): @@ -148,7 +150,7 @@ def template_specs(self): else: raise ValueError("API version {} does not have operation group 'template_specs'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) def close(self): self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py index 98392b01d1e78..5f6e64383715e 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/aio/_template_specs_client.py @@ -70,6 +70,8 @@ def __init__( profile: KnownProfiles = KnownProfiles.default, **kwargs: Any ) -> None: + if api_version: + kwargs.setdefault('api_version', api_version) self._config = TemplateSpecsClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(TemplateSpecsClient, self).__init__( @@ -125,7 +127,7 @@ def template_spec_versions(self): else: raise ValueError("API version {} does not have operation group 'template_spec_versions'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) @property def template_specs(self): @@ -148,7 +150,7 @@ def template_specs(self): else: raise ValueError("API version {} does not have operation group 'template_specs'".format(api_version)) self._config.api_version = api_version - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) async def close(self): await self._client.close() diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py index 0f68160935857..5ca24e4f805cf 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-06-01-preview" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py index 3b608ee4c0ff5..388d341f7093c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2019-06-01-preview" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2019-06-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py index 8d4db23f7a320..979b011beda71 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/aio/operations/_operations.py @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -160,7 +161,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -311,7 +314,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -399,7 +404,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -466,7 +473,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -519,7 +528,9 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -616,7 +627,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -708,6 +721,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -813,7 +827,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -975,7 +991,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1058,7 +1076,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1127,7 +1147,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1182,7 +1204,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py index d38a7d594d401..468b76571c7ee 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2019_06_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_template_specs_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,7 +100,7 @@ def build_template_specs_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_template_specs_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -179,7 +179,7 @@ def build_template_specs_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -205,7 +205,7 @@ def build_template_specs_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -243,7 +243,7 @@ def build_template_specs_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -289,7 +289,7 @@ def build_template_spec_versions_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -335,7 +335,7 @@ def build_template_spec_versions_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_template_spec_versions_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -423,7 +423,7 @@ def build_template_spec_versions_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +458,7 @@ def build_template_spec_versions_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -487,6 +487,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -582,7 +583,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -733,7 +736,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -821,7 +826,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -888,7 +895,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -941,7 +950,9 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1038,7 +1049,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1130,6 +1143,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1235,7 +1249,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1397,7 +1413,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1480,7 +1498,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1549,7 +1569,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1604,7 +1626,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2019-06-01-preview") + ) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py index a17951122cbd3..eade9d6a0f26a 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-03-01-preview" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-03-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py index 6731633bc380d..33a023085e77f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-03-01-preview" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-03-01-preview" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py index 523d8f32ab39c..80e05c4ff4295 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/aio/operations/_operations.py @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -160,7 +161,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -311,7 +314,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -399,7 +404,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -466,7 +473,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -519,7 +528,9 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -616,7 +627,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -708,6 +721,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -813,7 +827,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -975,7 +991,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1058,7 +1076,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1127,7 +1147,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1182,7 +1204,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py index 64c81ce31ddda..91cb5be5ba329 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_03_01_preview/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_template_specs_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,7 +100,7 @@ def build_template_specs_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_template_specs_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -179,7 +179,7 @@ def build_template_specs_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -205,7 +205,7 @@ def build_template_specs_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -243,7 +243,7 @@ def build_template_specs_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -289,7 +289,7 @@ def build_template_spec_versions_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -335,7 +335,7 @@ def build_template_spec_versions_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_template_spec_versions_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -423,7 +423,7 @@ def build_template_spec_versions_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +458,7 @@ def build_template_spec_versions_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -487,6 +487,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -582,7 +583,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -733,7 +736,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -821,7 +826,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -888,7 +895,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -941,7 +950,9 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1038,7 +1049,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1130,6 +1143,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1235,7 +1249,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1397,7 +1413,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1480,7 +1498,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1549,7 +1569,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1604,7 +1626,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01-preview")) + api_version: str = kwargs.pop( + "api_version", _params.pop("api-version", self._api_version or "2021-03-01-preview") + ) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py index d0a7859a01c80..bda3ca420c08c 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-05-01" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py index cbc7b55219c65..11bd80c574dec 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2021-05-01" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2021-05-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py index 354ea3f395579..fbd395313b23d 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/aio/operations/_operations.py @@ -65,6 +65,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -159,7 +160,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -310,7 +311,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -398,7 +399,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -465,7 +466,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -518,7 +519,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -615,7 +616,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -707,6 +708,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -812,7 +814,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -973,7 +975,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1056,7 +1058,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1125,7 +1127,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1180,7 +1182,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py index 2888401f8c8ee..8d25468a6cb8b 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2021_05_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_template_specs_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,7 +100,7 @@ def build_template_specs_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_template_specs_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -179,7 +179,7 @@ def build_template_specs_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -205,7 +205,7 @@ def build_template_specs_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -243,7 +243,7 @@ def build_template_specs_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -289,7 +289,7 @@ def build_template_spec_versions_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -335,7 +335,7 @@ def build_template_spec_versions_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -380,7 +380,7 @@ def build_template_spec_versions_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -423,7 +423,7 @@ def build_template_spec_versions_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -458,7 +458,7 @@ def build_template_spec_versions_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -487,6 +487,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -581,7 +582,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -732,7 +733,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -820,7 +821,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -887,7 +888,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -940,7 +941,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1037,7 +1038,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1129,6 +1130,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1234,7 +1236,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1395,7 +1397,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1478,7 +1480,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1547,7 +1549,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1602,7 +1604,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py index c5be4cd77b16c..5b765fe054b56 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-02-01" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py index bd0df84f5319f..0dafe0e287ff1 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_vendor.py @@ -5,8 +5,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast - from azure.core.pipeline.transport import HttpRequest @@ -16,15 +14,3 @@ def _convert_request(request, files=None): if files: request.set_formdata_body(files) return request - - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py index 6dc5ff1c1944f..e5754a47ce68f 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py index a6249266b56ad..4c7984652a5d3 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/_template_specs_client.py @@ -60,9 +60,11 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.template_specs = TemplateSpecsOperations(self._client, self._config, self._serialize, self._deserialize) + self.template_specs = TemplateSpecsOperations( + self._client, self._config, self._serialize, self._deserialize, "2022-02-01" + ) self.template_spec_versions = TemplateSpecVersionsOperations( - self._client, self._config, self._serialize, self._deserialize + self._client, self._config, self._serialize, self._deserialize, "2022-02-01" ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py index 276603258b271..cc4a3d8b84020 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/aio/operations/_operations.py @@ -69,6 +69,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -163,7 +164,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -314,7 +315,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -402,7 +403,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -469,7 +470,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -522,7 +523,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -619,7 +620,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -723,7 +724,7 @@ async def get_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_built_in_request( @@ -777,7 +778,7 @@ def list_built_ins( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -865,6 +866,7 @@ def __init__(self, *args, **kwargs) -> None: self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload async def create_or_update( @@ -970,7 +972,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1131,7 +1133,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1214,7 +1216,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1283,7 +1285,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1338,7 +1340,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { @@ -1426,7 +1428,7 @@ def list_built_ins(self, template_spec_name: str, **kwargs: Any) -> AsyncIterabl _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { @@ -1521,7 +1523,7 @@ async def get_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_built_in_request( diff --git a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py index 9d136c717afd1..8ae0cbfe0c657 100644 --- a/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py +++ b/sdk/resources/azure-mgmt-resource/azure/mgmt/resource/templatespecs/v2022_02_01/operations/_operations.py @@ -28,7 +28,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +62,7 @@ def build_template_specs_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,7 +100,7 @@ def build_template_specs_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +142,7 @@ def build_template_specs_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -179,7 +179,7 @@ def build_template_specs_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -205,7 +205,7 @@ def build_template_specs_list_by_subscription_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -243,7 +243,7 @@ def build_template_specs_list_by_resource_group_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -273,7 +273,7 @@ def build_template_specs_get_built_in_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -342,7 +342,7 @@ def build_template_spec_versions_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -388,7 +388,7 @@ def build_template_spec_versions_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -433,7 +433,7 @@ def build_template_spec_versions_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -476,7 +476,7 @@ def build_template_spec_versions_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -511,7 +511,7 @@ def build_template_spec_versions_list_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -537,7 +537,7 @@ def build_template_spec_versions_list_built_ins_request(template_spec_name: str, ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -576,7 +576,7 @@ def build_template_spec_versions_get_built_in_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -605,6 +605,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -699,7 +700,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -850,7 +851,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) @@ -938,7 +939,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_request( @@ -1005,7 +1006,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_specs_delete_request( @@ -1058,7 +1059,7 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1155,7 +1156,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1259,7 +1260,7 @@ def get_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpec] = kwargs.pop("cls", None) request = build_template_specs_get_built_in_request( @@ -1313,7 +1314,7 @@ def list_built_ins( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecsListResult] = kwargs.pop("cls", None) error_map = { @@ -1401,6 +1402,7 @@ def __init__(self, *args, **kwargs): self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") @overload def create_or_update( @@ -1506,7 +1508,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1667,7 +1669,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) @@ -1750,7 +1752,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_request( @@ -1819,7 +1821,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_template_spec_versions_delete_request( @@ -1874,7 +1876,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { @@ -1962,7 +1964,7 @@ def list_built_ins(self, template_spec_name: str, **kwargs: Any) -> Iterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersionsListResult] = kwargs.pop("cls", None) error_map = { @@ -2057,7 +2059,7 @@ def get_built_in( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.TemplateSpecVersion] = kwargs.pop("cls", None) request = build_template_spec_versions_get_built_in_request(